]> sourceware.org Git - lvm2.git/commitdiff
Add logging for pipe write() and close() error
authorZdenek Kabelac <zkabelac@redhat.com>
Wed, 1 Dec 2010 10:46:20 +0000 (10:46 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 1 Dec 2010 10:46:20 +0000 (10:46 +0000)
Check values from write() and close() system calls.

FIXME: Missing wrapper around 'write()'.

WHATS_NEW
daemons/clvmd/clvmd.c

index 7dba983ee339df9d57dca4dd22844c3307f3e4b9..eed8515ed290e4dcd21003b77bfecec05a47b90c 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.78 - 
 ====================================
+  Add logging for pipe write() and close() error in clvmd child_init_signal().
   Add test for existance of orphan vginfo in _lvmcache_update_vgname().
   Do a full rescan if some device is missing in read_pvs_in_vg().
   Avoid misleading warnings in vgextend --restoremissing in certain cases.
index 9c0fc5fa4e2ae73e6b5bb597aa334530b9fb297c..b4215fbc19d5e4e154245fac621b2863acbb360a 100644 (file)
@@ -180,9 +180,12 @@ static void usage(char *prog, FILE *file)
 /* Called to signal the parent how well we got on during initialisation */
 static void child_init_signal(int status)
 {
-        if (child_pipe[1]) {
-               write(child_pipe[1], &status, sizeof(status));
-               close(child_pipe[1]);
+       if (child_pipe[1]) {
+               /* FIXME Use a proper wrapper around write */
+               if (write(child_pipe[1], &status, sizeof(status)) < 0)
+                       log_sys_error("write", "child_pipe");
+               if (close(child_pipe[1]))
+                       log_sys_error("close", "child_pipe");
        }
 }
 
This page took 0.049432 seconds and 5 git commands to generate.