Commit f5de141b34f3ca1c5aef58403cfd16cf10715bff
1 parent
eeb7c03c
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>
Showing
1 changed file
with
6 additions
and
2 deletions
qemu-nbd.c
@@ -345,8 +345,12 @@ int main(int argc, char **argv) | @@ -345,8 +345,12 @@ int main(int argc, char **argv) | ||
345 | pid_t pid; | 345 | pid_t pid; |
346 | int sock; | 346 | int sock; |
347 | 347 | ||
348 | - if (!verbose) | ||
349 | - daemon(0, 0); /* detach client and server */ | 348 | + if (!verbose) { |
349 | + /* detach client and server */ | ||
350 | + if (daemon(0, 0) == -1) { | ||
351 | + errx(errno, "Failed to daemonize"); | ||
352 | + } | ||
353 | + } | ||
350 | 354 | ||
351 | if (socket == NULL) { | 355 | if (socket == NULL) { |
352 | sprintf(sockpath, SOCKET_PATH, basename(device)); | 356 | sprintf(sockpath, SOCKET_PATH, basename(device)); |