From 5f6d67b7d6ec5b7d2b9c5d163a4fa8cf0b688b84 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Sat, 3 Jun 2006 20:53:18 +0000 Subject: - no need to have timer_duration in the data section. - cleanup a little bit while at it. --- miscutils/watchdog.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'miscutils/watchdog.c') 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 @@ * Mini watchdog implementation for busybox * * Copyright (C) 2003 Paul Mundt + * Copyright (C) 2006 Bernhard Fischer * * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. */ @@ -14,9 +15,6 @@ #include #include -/* Userspace timer duration, in seconds */ -static unsigned int timer_duration = 30; - /* Watchdog file descriptor */ static int fd; @@ -29,11 +27,10 @@ static void watchdog_shutdown(int ATTRIBUTE_UNUSED unused) int watchdog_main(int argc, char **argv) { - + unsigned long timer_duration = 30; /* Userspace timer duration, in seconds */ char *t_arg; - unsigned long flags; - flags = bb_getopt_ulflags(argc, argv, "t:", &t_arg); - if (flags & 1) + + if (bb_getopt_ulflags(argc, argv, "t:", &t_arg)) timer_duration = bb_xgetlarg(t_arg, 10, 0, INT_MAX); /* We're only interested in the watchdog device .. */ -- cgit v1.2.3