From: Miroslav Lichvar Date: Wed, 29 Apr 2009 11:53:02 +0000 (+0200) Subject: Don't finalise from signal handler X-Git-Tag: 1.24-pre1~96 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9416a24f03be098f034ac8ee58672c01620309bb;p=thirdparty%2Fchrony.git Don't finalise from signal handler --- diff --git a/main.c b/main.c index bd406522..42f44f74 100644 --- a/main.c +++ b/main.c @@ -123,7 +123,8 @@ static void signal_cleanup(int x) { LOG(LOGS_WARN, LOGF_Main, "chronyd exiting on signal"); - MAI_CleanupAndExit(); + if (!initialised) exit(0); + SCH_QuitProgram(); } /* ================================================== */ diff --git a/sched.c b/sched.c index 3b0c711e..56505174 100644 --- a/sched.c +++ b/sched.c @@ -558,7 +558,8 @@ SCH_MainLoop(void) status = select(one_highest_fd, &rd, &wr, &ex, ptv); if (status < 0) { - CROAK("Status < 0 after select"); + if (!need_to_exit) + CROAK("Status < 0 after select"); } else if (status > 0) { /* A file descriptor is ready to read */