From 49e99a739361b977b0841c602f10fc9895285197 Mon Sep 17 00:00:00 2001 From: Christian Ruppert Date: Thu, 29 Dec 2011 13:55:47 +0100 Subject: 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 --- src/rc/rc-logger.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/rc/rc-logger.c') diff --git a/src/rc/rc-logger.c b/src/rc/rc-logger.c index 22d7c725..c0853159 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)); } -- cgit v1.2.3