]> sourceware.org Git - lvm2.git/commitdiff
Fix some compile warnings on RHEL5
authorMilan Broz <mbroz@redhat.com>
Tue, 1 Mar 2011 20:17:56 +0000 (20:17 +0000)
committerMilan Broz <mbroz@redhat.com>
Tue, 1 Mar 2011 20:17:56 +0000 (20:17 +0000)
- returned char not needed to be explicitly const
- warn if pipe() fails in clvmd (more fixes here needed for error paths...)
- assign (and ignore) read() output in drain buffer

daemons/clvmd/clvmd.c
daemons/dmeventd/libdevmapper-event.c
lib/display/display.c
lib/display/display.h

index d74a8805959391e988b380e89ee7c704ced520e2..00d330dc8dea3178131f45fdb0ed960a7ccc58de 100644 (file)
@@ -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;
index 8af2e3a79eeff74708e25eed2a64b87f7fd48373..8dc83284a362dd9f2637c976c56f3f4ddf47b9e0 100644 (file)
@@ -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) {
index 5be048ef080eef5617074ca70cfc8754f2e7c8f9..0c42a023410a6b10153ea64d99a3b7b410d16052 100644 (file)
@@ -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;
 
index fb000a256137a963b81e7805d073b48219fd359f..8462901957b085f176dbcbe4f82e0556600c0803 100644 (file)
@@ -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)));
This page took 0.047992 seconds and 5 git commands to generate.