From 3bdb434ea32b114c4b2fa282ff07e026337ec447 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 14 Dec 2022 14:28:40 -0500 Subject: [PATCH] MT#55283 add extra output on fatal error These errors occur during startup, so do an extra print to stderr to make sure the error is seen. Change-Id: I0bb85e6b09a51b9f22e2db5fb860bdb2d53856d8 --- lib/loglib.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/loglib.h b/lib/loglib.h index 26db30198..64d99fadb 100644 --- a/lib/loglib.h +++ b/lib/loglib.h @@ -103,7 +103,11 @@ INLINE int __get_log_level(unsigned int idx) { -#define die(fmt, ...) do { ilog(LOG_CRIT, "Fatal error: " fmt, ##__VA_ARGS__); exit(-1); } while (0) +#define die(fmt, ...) do { \ + fprintf(stderr, "Fatal error: " fmt "\n", ##__VA_ARGS__); \ + ilog(LOG_CRIT, "Fatal error: " fmt, ##__VA_ARGS__); \ + exit(-1); \ +} while (0) #define die_errno(msg, ...) die(msg ": %s", ##__VA_ARGS__, strerror(errno))