From f8271f58d0f47f7a7ffa787512c227982eb4d6f2 Mon Sep 17 00:00:00 2001 From: Bjørn Mork Date: Tue, 23 Jun 2015 14:18:02 +0200 Subject: ripe-atlas-fw: imported version 4700 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bjørn Mork --- eperd/eperd.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'eperd/eperd.c') diff --git a/eperd/eperd.c b/eperd/eperd.c index 49c5884..30a485d 100644 --- a/eperd/eperd.c +++ b/eperd/eperd.c @@ -91,14 +91,14 @@ struct CronLine { enum { - OPT_l = (1 << 0), - OPT_L = (1 << 1), - OPT_f = (1 << 2), - OPT_b = (1 << 3), - OPT_S = (1 << 4), - OPT_c = (1 << 5), - OPT_A = (1 << 6), - OPT_D = (1 << 7), + OPT_i = (1 << 0), + OPT_l = (1 << 1), + OPT_L = (1 << 2), + OPT_f = (1 << 3), + OPT_c = (1 << 4), + OPT_A = (1 << 5), + OPT_D = (1 << 6), + OPT_P = (1 << 7), OPT_d = (1 << 8) * ENABLE_FEATURE_CROND_D, }; #if ENABLE_FEATURE_CROND_D @@ -196,8 +196,11 @@ static void kick_watchdog(void) if(do_kick_watchdog) { int fdwatchdog = open("/dev/watchdog", O_RDWR); - write(fdwatchdog, "1", 1); - close(fdwatchdog); + if (fdwatchdog != -1) + { + write(fdwatchdog, "1", 1); + close(fdwatchdog); + } } } @@ -263,7 +266,7 @@ int eperd_main(int argc UNUSED_PARAM, char **argv) /* "-b after -f is ignored", and so on for every pair a-b */ opt_complementary = "f-b:b-f:S-L:L-S" USE_FEATURE_PERD_D(":d-l") "i:+:l+:d+"; /* -i, -l and -d have numeric param */ - opt = getopt32(argv, "i:l:L:fbSc:A:DP:" USE_FEATURE_PERD_D("d:") "O:", + opt = getopt32(argv, "i:l:L:fc:A:DP:" USE_FEATURE_PERD_D("d:") "O:", &instance_id, &LogLevel, &LogFile, &CDir, &atlas_id, &PidFileName USE_FEATURE_PERD_D(,&LogLevel), &out_filename); -- cgit v1.2.3