aboutsummaryrefslogtreecommitdiff
path: root/qemu-nbd.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2009-06-15 12:49:59 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2009-06-15 12:51:37 -0500
commitf5de141b34f3ca1c5aef58403cfd16cf10715bff (patch)
treebd1e213daa48162ed744b5252bd2b14d35186bfd /qemu-nbd.c
parenteeb7c03c0f49a8678028a734f1d6575f36a44edc (diff)
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 <aliguori@us.ibm.com>
Diffstat (limited to 'qemu-nbd.c')
-rw-r--r--qemu-nbd.c8
1 files 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));