From: Miroslav Lichvar Date: Tue, 5 Aug 2014 13:15:15 +0000 (+0200) Subject: logging: move exit call from LOG_Message to LOG_FATAL X-Git-Tag: 1.31-pre1~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51a2b436f429f3055d3fc4982917588e8dfd3cdb;p=thirdparty%2Fchrony.git logging: move exit call from LOG_Message to LOG_FATAL --- diff --git a/logging.c b/logging.c index f8ae7602..3ba71fcf 100644 --- a/logging.c +++ b/logging.c @@ -187,9 +187,6 @@ void LOG_Message(LOG_Severity severity, LOG_Facility facility, log_message(1, severity, buf); } } - - exit(1); - break; default: assert(0); diff --git a/logging.h b/logging.h index 2c8a78fe..898cde9f 100644 --- a/logging.h +++ b/logging.h @@ -49,7 +49,11 @@ extern int log_debug_enabled; LOG_Message(LOGS_DEBUG, facility, __LINE__, __FILE__, FUNCTION_NAME, __VA_ARGS__); \ } while (0) #define LOG(severity, facility, ...) LOG_Message(severity, facility, __LINE__, __FILE__, FUNCTION_NAME, __VA_ARGS__) -#define LOG_FATAL(facility, ...) LOG_Message(LOGS_FATAL, facility, __LINE__, __FILE__, FUNCTION_NAME, __VA_ARGS__) +#define LOG_FATAL(facility, ...) \ + do { \ + LOG_Message(LOGS_FATAL, facility, __LINE__, __FILE__, FUNCTION_NAME, __VA_ARGS__); \ + exit(1); \ + } while (0) /* Definition of severity */ typedef enum {