From: Miroslav Lichvar Date: Thu, 10 Oct 2019 13:07:10 +0000 (+0200) Subject: logging: call exit() in LOG_Message() X-Git-Tag: 4.0-pre1~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4c6a00b2a11;p=thirdparty%2Fchrony.git logging: call exit() in LOG_Message() Call exit() in LOG_Message() after printing a fatal message to allow the LOG macro or LOG_Message() to be used directly instead of the LOG_FATAL macro. --- diff --git a/logging.c b/logging.c index b6a0489b..e12bad7f 100644 --- a/logging.c +++ b/logging.c @@ -169,6 +169,7 @@ void LOG_Message(LOG_Severity severity, system_log = 0; log_message(1, severity, buf); } + exit(1); break; default: assert(0); diff --git a/sys_timex.c b/sys_timex.c index e54ad248..0a6b4387 100644 --- a/sys_timex.c +++ b/sys_timex.c @@ -256,10 +256,8 @@ SYS_Timex_Adjust(struct timex *txc, int ignore_error) state = NTP_ADJTIME(txc); if (state < 0) { - if (!ignore_error) - LOG_FATAL(NTP_ADJTIME_NAME"(0x%x) failed : %s", txc->modes, strerror(errno)); - else - DEBUG_LOG(NTP_ADJTIME_NAME"(0x%x) failed : %s", txc->modes, strerror(errno)); + LOG(ignore_error ? LOGS_DEBUG : LOGS_FATAL, + NTP_ADJTIME_NAME"(0x%x) failed : %s", txc->modes, strerror(errno)); } return state;