mirror of
https://github.com/reactos/ccache.git
synced 2025-01-09 13:00:37 +00:00
Make fatal() exit like it should even if CCACHE_LOGFILE isn't set
This commit is contained in:
parent
614a19141a
commit
20cca3c195
18
util.c
18
util.c
@ -67,16 +67,18 @@ void fatal(const char *format, ...)
|
||||
va_list ap;
|
||||
extern char *cache_logfile;
|
||||
|
||||
if (!cache_logfile) return;
|
||||
|
||||
if (!logfile) logfile = fopen(cache_logfile, "a");
|
||||
if (!logfile) return;
|
||||
|
||||
va_start(ap, format);
|
||||
|
||||
fprintf(logfile, "[%-5d] FATAL: ", getpid());
|
||||
vfprintf(logfile, format, ap);
|
||||
fflush(logfile);
|
||||
if (cache_logfile) {
|
||||
if (!logfile) {
|
||||
logfile = fopen(cache_logfile, "a");
|
||||
}
|
||||
if (logfile) {
|
||||
fprintf(logfile, "[%-5d] FATAL: ", getpid());
|
||||
vfprintf(logfile, format, ap);
|
||||
fflush(logfile);
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "ccache: FATAL: ");
|
||||
vfprintf(stderr, format, ap);
|
||||
|
Loading…
Reference in New Issue
Block a user