aboutsummaryrefslogtreecommitdiff
path: root/miscutils/watchdog.c
diff options
context:
space:
mode:
authorlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-10-28 09:24:33 +0000
committerlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-10-28 09:24:33 +0000
commitac33ce8b9a72d0ed0a4a32e98917cb097d74fffd (patch)
treeea1bfb15742becbaab52960ee9fad82aba9fbcee /miscutils/watchdog.c
parente9b8e427edbf1071f03d694f12afc6d61ad29bf4 (diff)
downloadbusybox-w32-ac33ce8b9a72d0ed0a4a32e98917cb097d74fffd.tar.gz
busybox-w32-ac33ce8b9a72d0ed0a4a32e98917cb097d74fffd.tar.bz2
busybox-w32-ac33ce8b9a72d0ed0a4a32e98917cb097d74fffd.zip
Rob Sullivan sent in some cleanups, which I beat on slightly.
git-svn-id: svn://busybox.net/trunk/busybox@11946 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'miscutils/watchdog.c')
-rw-r--r--miscutils/watchdog.c34
1 files changed, 8 insertions, 26 deletions
diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c
index 276fadebd..4b00e50c6 100644
--- a/miscutils/watchdog.c
+++ b/miscutils/watchdog.c
@@ -4,20 +4,7 @@
4 * 4 *
5 * Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org> 5 * Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */ 8 */
22 9
23#include <stdio.h> 10#include <stdio.h>
@@ -40,19 +27,14 @@ static void watchdog_shutdown(int unused)
40 exit(0); 27 exit(0);
41} 28}
42 29
43extern int watchdog_main(int argc, char **argv) 30int watchdog_main(int argc, char **argv)
44{ 31{
45 int opt; 32
46 33 char *t_arg;
47 while ((opt = getopt(argc, argv, "t:")) > 0) { 34 unsigned long flags;
48 switch (opt) { 35 flags = bb_getopt_ulflags(argc, argv, "t:", &t_arg);
49 case 't': 36 if (flags & 1)
50 timer_duration = bb_xgetlarg(optarg, 10, 0, INT_MAX); 37 timer_duration = bb_xgetlarg(t_arg, 10, 0, INT_MAX);
51 break;
52 default:
53 bb_show_usage();
54 }
55 }
56 38
57 /* We're only interested in the watchdog device .. */ 39 /* We're only interested in the watchdog device .. */
58 if (optind < argc - 1 || argc == 1) 40 if (optind < argc - 1 || argc == 1)