FATAL() macro calls abort() to provoke core dump

This commit is contained in:
Andrew Bettison 2012-11-12 14:37:35 +10:30
parent cbc91d11e0
commit 70217a7e84

2
log.h
View File

@ -150,7 +150,7 @@ void set_log_implementation(void (*log_function)(int level, struct strbuf *buf))
#define logMessage_perror(L,whence,F,...) (logMessage(L, whence, F ": %s [errno=%d]", ##__VA_ARGS__, strerror(errno), errno))
#define FATALF(F,...) do { LOGF(LOG_LEVEL_FATAL, F, ##__VA_ARGS__); exit(-1); } while (1)
#define FATALF(F,...) do { LOGF(LOG_LEVEL_FATAL, F, ##__VA_ARGS__); abort(); exit(-1); } while (1)
#define FATAL(X) FATALF("%s", (X))
#define FATALF_perror(F,...) FATALF(F ": %s [errno=%d]", ##__VA_ARGS__, strerror(errno), errno)
#define FATAL_perror(X) FATALF_perror("%s", (X))