Report error during error log creation (#2625)
This commit is contained in:
parent
6da187b27f
commit
584263b1b3
|
@ -88,8 +88,13 @@ 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 (fcntl(fileno(errorfile), F_SETFD, FD_CLOEXEC)) {
|
if (!errorfile) {
|
||||||
fprintf(stderr, "Could not set close-on-exec flag\n");
|
fprintf(stderr, "Could not initialize errorlog on %s: %s\n",
|
||||||
|
errorfilename, strerror(errno));
|
||||||
|
} else {
|
||||||
|
if (fcntl(fileno(errorfile), F_SETFD, FD_CLOEXEC)) {
|
||||||
|
fprintf(stderr, "Could not set close-on-exec flag\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue