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 <gentoo-commits+bounces-419937-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1RpH7S-00009z-Cw
	for garchives@archives.gentoo.org; Mon, 23 Jan 2012 10:27:22 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id D9512E0819;
	Mon, 23 Jan 2012 10:27:12 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id AEE49E0819
	for <gentoo-commits@lists.gentoo.org>; Mon, 23 Jan 2012 10:27:12 +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 3512F1B4025
	for <gentoo-commits@lists.gentoo.org>; Mon, 23 Jan 2012 10:27:12 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by pelican.gentoo.org (Postfix) with ESMTP id 518BF80044
	for <gentoo-commits@lists.gentoo.org>; Mon, 23 Jan 2012 10:27:11 +0000 (UTC)
From: "Robin H. Johnson" <robbat2@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" <robbat2@gentoo.org>
Message-ID: <06b8084b2cf9308fe0cbbcdde0741a881b7609fb.robbat2@gentoo>
Subject: [gentoo-commits] proj/openrc:master commit in: src/rc/
X-VCS-Repository: proj/openrc
X-VCS-Files: src/rc/checkpath.c
X-VCS-Directories: src/rc/
X-VCS-Committer: robbat2
X-VCS-Committer-Name: Robin H. Johnson
X-VCS-Revision: 06b8084b2cf9308fe0cbbcdde0741a881b7609fb
Date: Mon, 23 Jan 2012 10:27:11 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: quoted-printable
X-Archives-Salt: ea74246e-9683-49f3-a1ab-3d1af9bd01b7
X-Archives-Hash: c4b88be4a505ddb1cd131836324592c5

commit:     06b8084b2cf9308fe0cbbcdde0741a881b7609fb
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 23 05:30:00 2012 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Mon Jan 23 05:30:00 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=3Dproj/openrc.git;a=3D=
commit;h=3D06b8084b

Ensure that when -F is passed, existing files are truncated properly.

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

---
 src/rc/checkpath.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c
index 0aee446..86623d9 100644
--- a/src/rc/checkpath.c
+++ b/src/rc/checkpath.c
@@ -61,7 +61,7 @@ do_check(char *path, uid_t uid, gid_t gid, mode_t mode,=
 inode_t type, bool trunc
 	struct stat st;
 	int fd, flags;
=20
-	if (stat(path, &st)) {
+	if (stat(path, &st) || trunc) {
 		if (type =3D=3D inode_file) {
 			einfo("%s: creating file", path);
 			if (!mode) /* 664 */