svn commit: trunk/busybox/miscutils

aldot at busybox.net aldot at busybox.net
Sat Jun 3 20:53:19 UTC 2006


Author: aldot
Date: 2006-06-03 13:53:18 -0700 (Sat, 03 Jun 2006)
New Revision: 15275

Log:
- no need to have timer_duration in the data section.
- cleanup a little bit while at it.


Modified:
   trunk/busybox/miscutils/watchdog.c


Changeset:
Modified: trunk/busybox/miscutils/watchdog.c
===================================================================
--- trunk/busybox/miscutils/watchdog.c	2006-06-03 20:09:02 UTC (rev 15274)
+++ trunk/busybox/miscutils/watchdog.c	2006-06-03 20:53:18 UTC (rev 15275)
@@ -3,6 +3,7 @@
  * Mini watchdog implementation for busybox
  *
  * Copyright (C) 2003  Paul Mundt <lethal at linux-sh.org>
+ * Copyright (C) 2006  Bernhard Fischer <busybox at busybox.net>
  *
  * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
  */
@@ -14,9 +15,6 @@
 #include <stdlib.h>
 #include <signal.h>
 
-/* Userspace timer duration, in seconds */
-static unsigned int timer_duration = 30;
-
 /* Watchdog file descriptor */
 static int fd;
 
@@ -29,11 +27,10 @@
 
 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 .. */




More information about the busybox-cvs mailing list