diff options
| author | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-06-03 20:53:18 +0000 |
|---|---|---|
| committer | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-06-03 20:53:18 +0000 |
| commit | 9cd8f332001ad9ff5105d0f88fbe57f835af96b9 (patch) | |
| tree | f9ec0f86f60dc00fa39bbc17d891f80040f937f6 /miscutils | |
| parent | ba49358136c0933433e4544cd3b80b4faea32a3d (diff) | |
| download | busybox-w32-9cd8f332001ad9ff5105d0f88fbe57f835af96b9.tar.gz busybox-w32-9cd8f332001ad9ff5105d0f88fbe57f835af96b9.tar.bz2 busybox-w32-9cd8f332001ad9ff5105d0f88fbe57f835af96b9.zip | |
- no need to have timer_duration in the data section.
- cleanup a little bit while at it.
git-svn-id: svn://busybox.net/trunk/busybox@15275 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'miscutils')
| -rw-r--r-- | miscutils/watchdog.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c index 6fcb8f83c..55fee8a40 100644 --- a/miscutils/watchdog.c +++ b/miscutils/watchdog.c | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | * Mini watchdog implementation for busybox | 3 | * Mini watchdog implementation for busybox |
| 4 | * | 4 | * |
| 5 | * Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org> | 5 | * Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org> |
| 6 | * Copyright (C) 2006 Bernhard Fischer <busybox@busybox.net> | ||
| 6 | * | 7 | * |
| 7 | * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. | 8 | * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. |
| 8 | */ | 9 | */ |
| @@ -14,9 +15,6 @@ | |||
| 14 | #include <stdlib.h> | 15 | #include <stdlib.h> |
| 15 | #include <signal.h> | 16 | #include <signal.h> |
| 16 | 17 | ||
| 17 | /* Userspace timer duration, in seconds */ | ||
| 18 | static unsigned int timer_duration = 30; | ||
| 19 | |||
| 20 | /* Watchdog file descriptor */ | 18 | /* Watchdog file descriptor */ |
| 21 | static int fd; | 19 | static int fd; |
| 22 | 20 | ||
| @@ -29,11 +27,10 @@ static void watchdog_shutdown(int ATTRIBUTE_UNUSED unused) | |||
| 29 | 27 | ||
| 30 | int watchdog_main(int argc, char **argv) | 28 | int watchdog_main(int argc, char **argv) |
| 31 | { | 29 | { |
| 32 | 30 | unsigned long timer_duration = 30; /* Userspace timer duration, in seconds */ | |
| 33 | char *t_arg; | 31 | char *t_arg; |
| 34 | unsigned long flags; | 32 | |
| 35 | flags = bb_getopt_ulflags(argc, argv, "t:", &t_arg); | 33 | if (bb_getopt_ulflags(argc, argv, "t:", &t_arg)) |
| 36 | if (flags & 1) | ||
| 37 | timer_duration = bb_xgetlarg(t_arg, 10, 0, INT_MAX); | 34 | timer_duration = bb_xgetlarg(t_arg, 10, 0, INT_MAX); |
| 38 | 35 | ||
| 39 | /* We're only interested in the watchdog device .. */ | 36 | /* We're only interested in the watchdog device .. */ |
