mirror of
https://github.com/sheumann/hush.git
synced 2024-09-13 06:54:44 +00:00
- no need to have timer_duration in the data section.
- cleanup a little bit while at it.
This commit is contained in:
parent
b1312c9125
commit
5f6d67b7d6
@ -3,6 +3,7 @@
|
|||||||
* Mini watchdog implementation for busybox
|
* Mini watchdog implementation for busybox
|
||||||
*
|
*
|
||||||
* Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
|
* Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
|
||||||
|
* Copyright (C) 2006 Bernhard Fischer <busybox@busybox.net>
|
||||||
*
|
*
|
||||||
* Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
|
* Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
|
||||||
*/
|
*/
|
||||||
@ -14,9 +15,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
/* Userspace timer duration, in seconds */
|
|
||||||
static unsigned int timer_duration = 30;
|
|
||||||
|
|
||||||
/* Watchdog file descriptor */
|
/* Watchdog file descriptor */
|
||||||
static int fd;
|
static int fd;
|
||||||
|
|
||||||
@ -29,11 +27,10 @@ static void watchdog_shutdown(int ATTRIBUTE_UNUSED unused)
|
|||||||
|
|
||||||
int watchdog_main(int argc, char **argv)
|
int watchdog_main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
unsigned long timer_duration = 30; /* Userspace timer duration, in seconds */
|
||||||
char *t_arg;
|
char *t_arg;
|
||||||
unsigned long flags;
|
|
||||||
flags = bb_getopt_ulflags(argc, argv, "t:", &t_arg);
|
if (bb_getopt_ulflags(argc, argv, "t:", &t_arg))
|
||||||
if (flags & 1)
|
|
||||||
timer_duration = bb_xgetlarg(t_arg, 10, 0, INT_MAX);
|
timer_duration = bb_xgetlarg(t_arg, 10, 0, INT_MAX);
|
||||||
|
|
||||||
/* We're only interested in the watchdog device .. */
|
/* We're only interested in the watchdog device .. */
|
||||||
|
Loading…
Reference in New Issue
Block a user