From 2c99851181a652358aa3ca58ef38c57e46ae02e4 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 12 Apr 2006 18:09:26 +0000 Subject: - patch from Denis Vlasenko to add and use bb_xdaemon() --- miscutils/crond.c | 5 ++--- miscutils/watchdog.c | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'miscutils') diff --git a/miscutils/crond.c b/miscutils/crond.c index 7e50b61..06b8769 100644 --- a/miscutils/crond.c +++ b/miscutils/crond.c @@ -1,3 +1,4 @@ +/* vi: set sw=4 ts=4: */ /* * crond -d[#] -c -f -b * @@ -213,9 +214,7 @@ int crond_main(int ac, char **av) /* reexec for vfork() do continue parent */ vfork_daemon_rexec(1, 0, ac, av, "-f"); #else /* uClinux */ - if (daemon(1, 0) < 0) { - bb_perror_msg_and_die("daemon"); - } + bb_xdaemon(1, 0); #endif /* uClinux */ } diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c index 55dd698..58a6065 100644 --- a/miscutils/watchdog.c +++ b/miscutils/watchdog.c @@ -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); -- cgit v1.1