From f5de141b34f3ca1c5aef58403cfd16cf10715bff Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Mon, 15 Jun 2009 12:49:59 -0500 Subject: [PATCH] Fix warning in qemu-nbd.c qemu-nbd.c:349: error: ignoring return value of 'daemon', declared with attribute warn_unused_result Signed-off-by: Anthony Liguori --- qemu-nbd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index 0af97ca2c7..9101487128 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));