qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [COMMIT f5de141] Fix warning in qemu-nbd.c


From: Anthony Liguori
Subject: [Qemu-commits] [COMMIT f5de141] Fix warning in qemu-nbd.c
Date: Mon, 15 Jun 2009 18:18:53 -0000

From: Anthony Liguori <address@hidden>

qemu-nbd.c:349: error: ignoring return value of 'daemon', declared with 
attribute warn_unused_result

Signed-off-by: Anthony Liguori <address@hidden>

diff --git a/qemu-nbd.c b/qemu-nbd.c
index 0af97ca..9101487 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -345,8 +345,12 @@ int main(int argc, char **argv)
         pid_t pid;
         int sock;
 
-        if (!verbose)
-            daemon(0, 0);      /* detach client and server */
+        if (!verbose) {
+            /* detach client and server */
+            if (daemon(0, 0) == -1) {
+                errx(errno, "Failed to daemonize");
+            }
+        }
 
         if (socket == NULL) {
             sprintf(sockpath, SOCKET_PATH, basename(device));




reply via email to

[Prev in Thread] Current Thread [Next in Thread]