diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-24 12:11:17 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-24 12:11:17 +0000 |
| commit | 9067f13be067f39f6c8586926b190b7dee0def3d (patch) | |
| tree | ff0a10f5f81fa0e1e719691c147309a9cc9bef46 /miscutils | |
| parent | 1b6fa4c57ced2ae89f51bdc073410c4be5384007 (diff) | |
| download | busybox-w32-9067f13be067f39f6c8586926b190b7dee0def3d.tar.gz busybox-w32-9067f13be067f39f6c8586926b190b7dee0def3d.tar.bz2 busybox-w32-9067f13be067f39f6c8586926b190b7dee0def3d.zip | |
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')
| -rw-r--r-- | miscutils/crond.c | 4 | ||||
| -rw-r--r-- | miscutils/watchdog.c | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/miscutils/crond.c b/miscutils/crond.c index d237a677e..1ab0038e0 100644 --- a/miscutils/crond.c +++ b/miscutils/crond.c | |||
| @@ -191,8 +191,8 @@ int crond_main(int ac, char **av) | |||
| 191 | 191 | ||
| 192 | if (!(opt & 4)) { | 192 | if (!(opt & 4)) { |
| 193 | #ifdef BB_NOMMU | 193 | #ifdef BB_NOMMU |
| 194 | /* reexec for vfork() do continue parent */ | 194 | if (!re_execed) |
| 195 | vfork_daemon_rexec(1, 0, ac, av, "-f"); | 195 | vfork_daemon_rexec(1, 0, av); |
| 196 | #else | 196 | #else |
| 197 | xdaemon(1, 0); | 197 | xdaemon(1, 0); |
| 198 | #endif | 198 | #endif |
diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c index ed9026d9e..e3d77d17e 100644 --- a/miscutils/watchdog.c +++ b/miscutils/watchdog.c | |||
| @@ -38,12 +38,14 @@ int watchdog_main(int argc, char **argv) | |||
| 38 | if (optind < argc - 1 || argc == 1) | 38 | if (optind < argc - 1 || argc == 1) |
| 39 | bb_show_usage(); | 39 | bb_show_usage(); |
| 40 | 40 | ||
| 41 | if (!(opts & OPT_FOREGROUND)) { | ||
| 41 | #ifdef BB_NOMMU | 42 | #ifdef BB_NOMMU |
| 42 | if (!(opts & OPT_FOREGROUND)) | 43 | if (!re_execed) |
| 43 | vfork_daemon_rexec(0, 1, argc, argv, "-F"); | 44 | vfork_daemon_rexec(0, 1, argv); |
| 44 | #else | 45 | #else |
| 45 | xdaemon(0, 1); | 46 | xdaemon(0, 1); |
| 46 | #endif | 47 | #endif |
| 48 | } | ||
| 47 | 49 | ||
| 48 | signal(SIGHUP, watchdog_shutdown); | 50 | signal(SIGHUP, watchdog_shutdown); |
| 49 | signal(SIGINT, watchdog_shutdown); | 51 | signal(SIGINT, watchdog_shutdown); |
