Don't try to write the log during sysinit
During the sysinit and shutdown runlevels the logfile destination may be read-only. Skip the error messages in this case. X-Gentoo-Bug: 390645 X-Gentoo-Bug-URL: https://bugs.gentoo.org/390645
This commit is contained in:
parent
8dcb7554ee
commit
49e99a7393
@ -277,10 +277,10 @@ rc_logger_open(const char *level)
|
|||||||
fclose(plog);
|
fclose(plog);
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* logfile or its basedir may be read-only during shutdown so skip
|
* logfile or its basedir may be read-only during sysinit and
|
||||||
* the error in this case
|
* shutdown so skip the error in this case
|
||||||
*/
|
*/
|
||||||
if (strcmp(level, RC_LEVEL_SHUTDOWN) != 0) {
|
if ((strcmp(level, RC_LEVEL_SHUTDOWN) != 0) && (strcmp(level, RC_LEVEL_SYSINIT) != 0)) {
|
||||||
log_error = 1;
|
log_error = 1;
|
||||||
eerror("Error: fopen(%s) failed: %s", logfile, strerror(errno));
|
eerror("Error: fopen(%s) failed: %s", logfile, strerror(errno));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user