From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id D1322138A61 for ; Fri, 15 Feb 2013 19:35:07 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 699B6E0540; Fri, 15 Feb 2013 19:35:06 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id F2E37E0540 for ; Fri, 15 Feb 2013 19:35:05 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E8F0E33D7C7 for ; Fri, 15 Feb 2013 19:35:04 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 7F535E4073 for ; Fri, 15 Feb 2013 19:35:03 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1360956515.970893adf3a2f0f7330c4839a716566de14171a3.WilliamH@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: src/rc/ X-VCS-Repository: proj/openrc X-VCS-Files: src/rc/runscript.c X-VCS-Directories: src/rc/ X-VCS-Committer: WilliamH X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 970893adf3a2f0f7330c4839a716566de14171a3 X-VCS-Branch: master Date: Fri, 15 Feb 2013 19:35:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 780492c8-bb71-4738-bf5c-4e13dd4691d2 X-Archives-Hash: 6c59ba15fe987a6edbf99383a4559388 commit: 970893adf3a2f0f7330c4839a716566de14171a3 Author: Alexander Mezin gmail com> AuthorDate: Sat Feb 2 21:15:19 2013 +0000 Commit: William Hubbs gentoo org> CommitDate: Fri Feb 15 19:28:35 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=970893ad runscript: retry prefix flock if it is interrupted by a signal Reported-by: Pacho Ramos gentoo.org> X-Gentoo-Bug: 434800 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=434800 --- src/rc/runscript.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/rc/runscript.c b/src/rc/runscript.c index e504e4a..0eea335 100644 --- a/src/rc/runscript.c +++ b/src/rc/runscript.c @@ -311,8 +311,12 @@ write_prefix(const char *buffer, size_t bytes, bool *prefixed) lock_fd = open(PREFIX_LOCK, O_WRONLY | O_CREAT, 0664); if (lock_fd != -1) { - if (flock(lock_fd, LOCK_EX) != 0) - eerror("flock() failed: %s", strerror(errno)); + while (flock(lock_fd, LOCK_EX) != 0) { + if (errno != EINTR) { + eerror("flock() failed: %s", strerror(errno)); + break; + } + } } #ifdef RC_DEBUG else