]> sourceware.org Git - lvm2.git/commitdiff
Check and print perror for syscalls
authorZdenek Kabelac <zkabelac@redhat.com>
Wed, 25 Jan 2012 21:30:27 +0000 (21:30 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 25 Jan 2012 21:30:27 +0000 (21:30 +0000)
daemons/common/daemon-server.c

index 1934bdb64f1b42f683afd52fe360396232919dc5..0e76c53d193f1e54778a833cc9991e32cd0453f6 100644 (file)
@@ -129,8 +129,10 @@ out:
 
 error:
        if (fd >= 0) {
-               close(fd);
-               unlink(s.socket_path);
+               if (close(fd))
+                       perror("close failed");
+               if (unlink(s.socket_path))
+                       perror("unlink failed");
                fd = -1;
        }
        goto out;
@@ -364,7 +366,8 @@ void daemon_start(daemon_state s)
        }
 
        if (s.socket_fd >= 0)
-               unlink(s.socket_path);
+               if (unlink(s.socket_path))
+                       perror("unlink error");
 
        if (s.daemon_fini)
                s.daemon_fini(&s);
This page took 0.05962 seconds and 5 git commands to generate.