From: Miroslav Lichvar Date: Mon, 30 Jun 2014 10:42:26 +0000 (+0200) Subject: sched: exit with fatal message when there is nothing to do X-Git-Tag: 1.30~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c6630905d2d00c31500eddde2142af24bf3bd33;p=thirdparty%2Fchrony.git sched: exit with fatal message when there is nothing to do With cmdport 0 and port 0, it's now possible that there is no descriptor watched or timer running, i.e. chronyd doing nothing and only waiting to be terminated. Replace the assertion with LOG_FATAL to exit properly. --- diff --git a/sched.c b/sched.c index 578c69c3..60dcf32c 100644 --- a/sched.c +++ b/sched.c @@ -592,7 +592,9 @@ SCH_MainLoop(void) /* if there are no file descriptors being waited on and no timeout set, this is clearly ridiculous, so stop the run */ - assert(ptv || n_read_fds); + if (!ptv && !n_read_fds) { + LOG_FATAL(LOGF_Scheduler, "Nothing to do"); + } /* Copy current set of read file descriptors */ memcpy((void *) &rd, (void *) &read_fds, sizeof(fd_set));