summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ruppert <idl0r@gentoo.org>2011-12-29 13:55:47 +0100
committerChristian Ruppert <idl0r@gentoo.org>2011-12-29 13:58:08 +0100
commit49e99a739361b977b0841c602f10fc9895285197 (patch)
tree6a6b0dea4ee352722bce992b001bd77b516e1ad5
parent8dcb7554ee627e9c1062cc1b4ab3bac8fcf89183 (diff)
downloadopenrc-49e99a739361b977b0841c602f10fc9895285197.tar.gz
openrc-49e99a739361b977b0841c602f10fc9895285197.tar.bz2
openrc-49e99a739361b977b0841c602f10fc9895285197.tar.xz
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
-rw-r--r--src/rc/rc-logger.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rc/rc-logger.c b/src/rc/rc-logger.c
index 22d7c72..c085315 100644
--- a/src/rc/rc-logger.c
+++ b/src/rc/rc-logger.c
@@ -277,10 +277,10 @@ rc_logger_open(const char *level)
fclose(plog);
} else {
/*
- * logfile or its basedir may be read-only during shutdown so skip
- * the error in this case
+ * logfile or its basedir may be read-only during sysinit and
+ * 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;
eerror("Error: fopen(%s) failed: %s", logfile, strerror(errno));
}