Remove some unused code pointed out by Tito, plus a slightly more graceful
[oweals/busybox.git] / miscutils / watchdog.c
index 55dd69857e1ec1fb9406f2ad686f67c860a18f82..58a6065536f1d5c5b4da7ae28e38269eaaa69719 100644 (file)
@@ -40,8 +40,7 @@ int watchdog_main(int argc, char **argv)
        if (optind < argc - 1 || argc == 1)
                bb_show_usage();
 
-       if (daemon(0, 1) < 0)
-               bb_perror_msg_and_die("Failed forking watchdog daemon");
+       bb_xdaemon(0, 1);
 
        signal(SIGHUP, watchdog_shutdown);
        signal(SIGINT, watchdog_shutdown);