diff options
| author | vapier <vapier@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-06-26 21:31:17 +0000 |
|---|---|---|
| committer | vapier <vapier@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-06-26 21:31:17 +0000 |
| commit | 119e057c58adaf22bd4889fc2b13729c30b48250 (patch) | |
| tree | ad4802094c0f43ad6f7772b790cb8a996eb066e5 /miscutils | |
| parent | 7c9d66cef366a9442cc99fb5b576e861d724352a (diff) | |
| download | busybox-w32-119e057c58adaf22bd4889fc2b13729c30b48250.tar.gz busybox-w32-119e057c58adaf22bd4889fc2b13729c30b48250.tar.bz2 busybox-w32-119e057c58adaf22bd4889fc2b13729c30b48250.zip | |
fix watchdog on no-mmu systems by adding -F option for rexec
git-svn-id: svn://busybox.net/trunk/busybox@15520 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'miscutils')
| -rw-r--r-- | miscutils/watchdog.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c index e8275e68e..ddd349d9b 100644 --- a/miscutils/watchdog.c +++ b/miscutils/watchdog.c | |||
| @@ -15,6 +15,9 @@ | |||
| 15 | #include <stdlib.h> | 15 | #include <stdlib.h> |
| 16 | #include <signal.h> | 16 | #include <signal.h> |
| 17 | 17 | ||
| 18 | #define OPT_FOREGROUND 0x01 | ||
| 19 | #define OPT_TIMER 0x02 | ||
| 20 | |||
| 18 | /* Watchdog file descriptor */ | 21 | /* Watchdog file descriptor */ |
| 19 | static int fd; | 22 | static int fd; |
| 20 | 23 | ||
| @@ -27,10 +30,13 @@ static void watchdog_shutdown(int ATTRIBUTE_UNUSED unused) | |||
| 27 | 30 | ||
| 28 | int watchdog_main(int argc, char **argv) | 31 | int watchdog_main(int argc, char **argv) |
| 29 | { | 32 | { |
| 33 | unsigned long opts; | ||
| 30 | unsigned long timer_duration = 30; /* Userspace timer duration, in seconds */ | 34 | unsigned long timer_duration = 30; /* Userspace timer duration, in seconds */ |
| 31 | char *t_arg; | 35 | char *t_arg; |
| 32 | 36 | ||
| 33 | if (bb_getopt_ulflags(argc, argv, "t:", &t_arg)) | 37 | opts = bb_getopt_ulflags(argc, argv, "Ft:", &t_arg); |
| 38 | |||
| 39 | if (opts & OPT_TIMER) | ||
| 34 | timer_duration = bb_xgetlarg(t_arg, 10, 0, INT_MAX); | 40 | timer_duration = bb_xgetlarg(t_arg, 10, 0, INT_MAX); |
| 35 | 41 | ||
| 36 | /* We're only interested in the watchdog device .. */ | 42 | /* We're only interested in the watchdog device .. */ |
| @@ -38,7 +44,8 @@ int watchdog_main(int argc, char **argv) | |||
| 38 | bb_show_usage(); | 44 | bb_show_usage(); |
| 39 | 45 | ||
| 40 | #ifdef BB_NOMMU | 46 | #ifdef BB_NOMMU |
| 41 | vfork_daemon(0, 1); | 47 | if (!(opts & OPT_FOREGROUND)) |
| 48 | vfork_daemon_rexec(0, 1, argc, argv, "-F"); | ||
| 42 | #else | 49 | #else |
| 43 | bb_xdaemon(0, 1); | 50 | bb_xdaemon(0, 1); |
| 44 | #endif | 51 | #endif |
