]> Git Repo - qemu.git/commitdiff
Fix warning in qemu-nbd.c
authorAnthony Liguori <[email protected]>
Mon, 15 Jun 2009 17:49:59 +0000 (12:49 -0500)
committerAnthony Liguori <[email protected]>
Mon, 15 Jun 2009 17:51:37 +0000 (12:51 -0500)
qemu-nbd.c:349: error: ignoring return value of 'daemon', declared with attribute warn_unused_result

Signed-off-by: Anthony Liguori <[email protected]>
qemu-nbd.c

index 0af97ca2c77f10e33ac3020036d917ff4efa7177..9101487128e204b7a872114b1aa8a937c278b291 100644 (file)
@@ -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));
This page took 0.023863 seconds and 4 git commands to generate.