aboutsummaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/crond.c5
-rw-r--r--miscutils/watchdog.c3
2 files changed, 3 insertions, 5 deletions
diff --git a/miscutils/crond.c b/miscutils/crond.c
index 7e50b61c7..06b8769fa 100644
--- a/miscutils/crond.c
+++ b/miscutils/crond.c
@@ -1,3 +1,4 @@
1/* vi: set sw=4 ts=4: */
1/* 2/*
2 * crond -d[#] -c <crondir> -f -b 3 * crond -d[#] -c <crondir> -f -b
3 * 4 *
@@ -213,9 +214,7 @@ int crond_main(int ac, char **av)
213 /* reexec for vfork() do continue parent */ 214 /* reexec for vfork() do continue parent */
214 vfork_daemon_rexec(1, 0, ac, av, "-f"); 215 vfork_daemon_rexec(1, 0, ac, av, "-f");
215#else /* uClinux */ 216#else /* uClinux */
216 if (daemon(1, 0) < 0) { 217 bb_xdaemon(1, 0);
217 bb_perror_msg_and_die("daemon");
218 }
219#endif /* uClinux */ 218#endif /* uClinux */
220 } 219 }
221 220
diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c
index 55dd69857..58a606553 100644
--- a/miscutils/watchdog.c
+++ b/miscutils/watchdog.c
@@ -40,8 +40,7 @@ int watchdog_main(int argc, char **argv)
40 if (optind < argc - 1 || argc == 1) 40 if (optind < argc - 1 || argc == 1)
41 bb_show_usage(); 41 bb_show_usage();
42 42
43 if (daemon(0, 1) < 0) 43 bb_xdaemon(0, 1);
44 bb_perror_msg_and_die("Failed forking watchdog daemon");
45 44
46 signal(SIGHUP, watchdog_shutdown); 45 signal(SIGHUP, watchdog_shutdown);
47 signal(SIGINT, watchdog_shutdown); 46 signal(SIGINT, watchdog_shutdown);