Browse Source

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
pull/1581/head
Richard Fuchs 3 years ago
parent
commit
3bdb434ea3
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      lib/loglib.h

+ 5
- 1
lib/loglib.h View File

@ -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))


Loading…
Cancel
Save