Report error during error log creation (#2625)
This commit is contained in:
parent
6da187b27f
commit
584263b1b3
|
@ -88,11 +88,16 @@ void init_logging(void) {
|
||||||
fprintf(stderr, "Could not initialize errorlog\n");
|
fprintf(stderr, "Could not initialize errorlog\n");
|
||||||
else {
|
else {
|
||||||
errorfile = fopen(errorfilename, "w");
|
errorfile = fopen(errorfilename, "w");
|
||||||
|
if (!errorfile) {
|
||||||
|
fprintf(stderr, "Could not initialize errorlog on %s: %s\n",
|
||||||
|
errorfilename, strerror(errno));
|
||||||
|
} else {
|
||||||
if (fcntl(fileno(errorfile), F_SETFD, FD_CLOEXEC)) {
|
if (fcntl(fileno(errorfile), F_SETFD, FD_CLOEXEC)) {
|
||||||
fprintf(stderr, "Could not set close-on-exec flag\n");
|
fprintf(stderr, "Could not set close-on-exec flag\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (physical_mem_bytes == 0) {
|
if (physical_mem_bytes == 0) {
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
int mib[2] = {CTL_HW, HW_MEMSIZE};
|
int mib[2] = {CTL_HW, HW_MEMSIZE};
|
||||||
|
|
Loading…
Reference in New Issue