From 552d3b53b19bf7f1ccf0ea14106ab4be9305e3e1 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Thu, 12 Mar 2020 14:25:21 +0100 Subject: [PATCH] main: accept zero timeout Allow -t to specify zero timeout to exit immediately. It might be useful for testing. --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index c5181ee..99f06c0 100644 --- a/main.c +++ b/main.c @@ -411,7 +411,7 @@ int main char *user = NULL, *log_file = NULL; struct passwd *pw; int opt, debug = 0, nofork = 0, address_family = IPADDR_UNSPEC; - int do_init_rtc = 0, restarted = 0, client_only = 0, timeout = 0; + int do_init_rtc = 0, restarted = 0, client_only = 0, timeout = -1; int scfilter_level = 0, lock_memory = 0, sched_priority = 0; int clock_control = 1, system_log = 1, log_severity = LOGS_INFO; int config_args = 0; @@ -614,7 +614,7 @@ int main REF_SetModeEndHandler(reference_mode_end); REF_SetMode(ref_mode); - if (timeout > 0) + if (timeout >= 0) SCH_AddTimeoutByDelay(timeout, quit_timeout, NULL); if (do_init_rtc) {