From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RrCey-0006yQ-D3 for garchives@archives.gentoo.org; Sat, 28 Jan 2012 18:05:57 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C57E0E0B9F; Sat, 28 Jan 2012 18:05:48 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 96233E0B9F for ; Sat, 28 Jan 2012 18:05:48 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1EE6E1B400B for ; Sat, 28 Jan 2012 18:05:48 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 668FA80044 for ; Sat, 28 Jan 2012 18:05:47 +0000 (UTC) From: "Christian Ruppert" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Christian Ruppert" Message-ID: <2d2751c4331a0204c4f7f6c4dd3994f34e0a4d47.idl0r@gentoo> Subject: [gentoo-commits] proj/openrc:master commit in: src/rc/ X-VCS-Repository: proj/openrc X-VCS-Files: src/rc/rc-logger.c X-VCS-Directories: src/rc/ X-VCS-Committer: idl0r X-VCS-Committer-Name: Christian Ruppert X-VCS-Revision: 2d2751c4331a0204c4f7f6c4dd3994f34e0a4d47 Date: Sat, 28 Jan 2012 18:05:47 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: ea7efed2-3da4-418c-a7df-732d6ed9b8b4 X-Archives-Hash: db692bd361de465a89cec1df57d9ccc4 commit: 2d2751c4331a0204c4f7f6c4dd3994f34e0a4d47 Author: Christian Ruppert gentoo org> AuthorDate: Sat Jan 28 17:56:29 2012 +0000 Commit: Christian Ruppert gentoo org> CommitDate: Sat Jan 28 17:59:16 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/openrc.git;a=3D= commit;h=3D2d2751c4 Do not unlink the temp. log during shutdown Also ignore errors in case of EROFS (Read-Only file systems) Reported-by: Maxim Kammerer X-Gentoo-Bug: 401115 X-Gentoo-Bug-URL: https://bugs.gentoo.org/401115 --- src/rc/rc-logger.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rc/rc-logger.c b/src/rc/rc-logger.c index c085315..468225f 100644 --- a/src/rc/rc-logger.c +++ b/src/rc/rc-logger.c @@ -280,7 +280,7 @@ rc_logger_open(const char *level) * 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) !=3D 0) && (strcmp(level, RC_LE= VEL_SYSINIT) !=3D 0)) { + if (errno !=3D EROFS && ((strcmp(level, RC_LEVEL_SHUTDOWN) !=3D 0) &&= (strcmp(level, RC_LEVEL_SYSINIT) !=3D 0))) { log_error =3D 1; eerror("Error: fopen(%s) failed: %s", logfile, strerror(errno)); } @@ -288,8 +288,9 @@ rc_logger_open(const char *level) =20 /* Try to keep the temporary log in case of errors */ if (!log_error) { - if (unlink(TMPLOG) =3D=3D -1) - eerror("Error: unlink(%s) failed: %s", TMPLOG, strerror(errno)); + if (errno !=3D EROFS && ((strcmp(level, RC_LEVEL_SHUTDOWN) !=3D 0) &&= (strcmp(level, RC_LEVEL_SYSINIT) !=3D 0))) + if (unlink(TMPLOG) =3D=3D -1) + eerror("Error: unlink(%s) failed: %s", TMPLOG, strerror(errno)); } else if (exists(TMPLOG)) eerrorx("Warning: temporary logfile left behind: %s", TMPLOG); =20