1 |
commit: 49e99a739361b977b0841c602f10fc9895285197 |
2 |
Author: Christian Ruppert <idl0r <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Dec 29 12:55:47 2011 +0000 |
4 |
Commit: Christian Ruppert <idl0r <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Dec 29 12:58:08 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=49e99a73 |
7 |
|
8 |
Don't try to write the log during sysinit |
9 |
|
10 |
During the sysinit and shutdown runlevels the logfile destination may be |
11 |
read-only. Skip the error messages in this case. |
12 |
|
13 |
X-Gentoo-Bug: 390645 |
14 |
X-Gentoo-Bug-URL: https://bugs.gentoo.org/390645 |
15 |
|
16 |
--- |
17 |
src/rc/rc-logger.c | 6 +++--- |
18 |
1 files changed, 3 insertions(+), 3 deletions(-) |
19 |
|
20 |
diff --git a/src/rc/rc-logger.c b/src/rc/rc-logger.c |
21 |
index 22d7c72..c085315 100644 |
22 |
--- a/src/rc/rc-logger.c |
23 |
+++ b/src/rc/rc-logger.c |
24 |
@@ -277,10 +277,10 @@ rc_logger_open(const char *level) |
25 |
fclose(plog); |
26 |
} else { |
27 |
/* |
28 |
- * logfile or its basedir may be read-only during shutdown so skip |
29 |
- * the error in this case |
30 |
+ * logfile or its basedir may be read-only during sysinit and |
31 |
+ * shutdown so skip the error in this case |
32 |
*/ |
33 |
- if (strcmp(level, RC_LEVEL_SHUTDOWN) != 0) { |
34 |
+ if ((strcmp(level, RC_LEVEL_SHUTDOWN) != 0) && (strcmp(level, RC_LEVEL_SYSINIT) != 0)) { |
35 |
log_error = 1; |
36 |
eerror("Error: fopen(%s) failed: %s", logfile, strerror(errno)); |
37 |
} |