diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c index d74a88059..00d330dc8 100644 --- a/daemons/clvmd/clvmd.c +++ b/daemons/clvmd/clvmd.c @@ -1007,7 +1007,10 @@ static void be_daemon(int timeout) exit(3); } - pipe(child_pipe); + if (pipe(child_pipe)) { + perror("Error creating pipe"); + exit(3); + } switch (fork()) { case -1: @@ -1254,7 +1257,9 @@ static int read_from_local_sock(struct local_client *thisfd) } /* Create a pipe and add the reading end to our FD list */ - pipe(comms_pipe); + if (pipe(comms_pipe)) + DEBUGLOG("creating pipe failed: %s\n", strerror(errno)); + newfd = malloc(sizeof(struct local_client)); if (!newfd) { struct clvm_header reply; diff --git a/daemons/dmeventd/libdevmapper-event.c b/daemons/dmeventd/libdevmapper-event.c index 8af2e3a79..8dc83284a 100644 --- a/daemons/dmeventd/libdevmapper-event.c +++ b/daemons/dmeventd/libdevmapper-event.c @@ -309,7 +309,7 @@ static int _daemon_write(struct dm_event_fifos *fifos, } if (ret == 0) break; - read(fifos->server, drainbuf, 127); + ret = read(fifos->server, drainbuf, 127); } while (bytes < size) { diff --git a/lib/display/display.c b/lib/display/display.c index 5be048ef0..0c42a0234 100644 --- a/lib/display/display.c +++ b/lib/display/display.c @@ -131,7 +131,7 @@ uint64_t units_to_bytes(const char *units, char *unit_type) return v * multiplier; } -const char alloc_policy_char(alloc_policy_t alloc) +char alloc_policy_char(alloc_policy_t alloc) { int i; diff --git a/lib/display/display.h b/lib/display/display.h index fb000a256..846290195 100644 --- a/lib/display/display.h +++ b/lib/display/display.h @@ -57,7 +57,7 @@ void display_segtypes(const struct cmd_context *cmd); * Allocation policy display conversion routines. */ const char *get_alloc_string(alloc_policy_t alloc); -const char alloc_policy_char(alloc_policy_t alloc); +char alloc_policy_char(alloc_policy_t alloc); alloc_policy_t get_alloc_from_string(const char *str); char yes_no_prompt(const char *prompt, ...) __attribute__ ((format(printf, 1, 2)));