summaryrefslogtreecommitdiff
path: root/miscutils/watchdog.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-03-24 12:11:17 +0000
committerDenis Vlasenko2007-03-24 12:11:17 +0000
commit9067f13be067f39f6c8586926b190b7dee0def3d (patch)
treeff0a10f5f81fa0e1e719691c147309a9cc9bef46 /miscutils/watchdog.c
parent1b6fa4c57ced2ae89f51bdc073410c4be5384007 (diff)
downloadbusybox-9067f13be067f39f6c8586926b190b7dee0def3d.zip
busybox-9067f13be067f39f6c8586926b190b7dee0def3d.tar.gz
NOMMU re-exec trick shuld not depend on existence of "don't daemonize"
option for every affected applet (and dnsd, for example, don't have one). Thus rework re-exec support to not require it. Code got smaller too.
Diffstat (limited to 'miscutils/watchdog.c')
-rw-r--r--miscutils/watchdog.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c
index ed9026d..e3d77d1 100644
--- a/miscutils/watchdog.c
+++ b/miscutils/watchdog.c
@@ -38,12 +38,14 @@ int watchdog_main(int argc, char **argv)
if (optind < argc - 1 || argc == 1)
bb_show_usage();
+ if (!(opts & OPT_FOREGROUND)) {
#ifdef BB_NOMMU
- if (!(opts & OPT_FOREGROUND))
- vfork_daemon_rexec(0, 1, argc, argv, "-F");
+ if (!re_execed)
+ vfork_daemon_rexec(0, 1, argv);
#else
- xdaemon(0, 1);
+ xdaemon(0, 1);
#endif
+ }
signal(SIGHUP, watchdog_shutdown);
signal(SIGINT, watchdog_shutdown);