]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
logging: move exit call from LOG_Message to LOG_FATAL
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 5 Aug 2014 13:15:15 +0000 (15:15 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 5 Aug 2014 13:15:15 +0000 (15:15 +0200)
logging.c
logging.h

index f8ae760285099f01db85b28774f43e8909fbb911..3ba71fcfc8324a8aafe3bb41fa85dd6efcdee8c3 100644 (file)
--- 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);
index 2c8a78fe8f079e8951ee99d95468d0eb4eeb95da..898cde9faff5db874a0df6150e68e4f1b0f7c217 100644 (file)
--- 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 {