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 06718138298 for ; Fri, 4 Jan 2013 04:25:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B9D6FE04EB; Fri, 4 Jan 2013 04:25:30 +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 41954E04EB for ; Fri, 4 Jan 2013 04:25:30 +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 3FC5133D77F for ; Fri, 4 Jan 2013 04:25:29 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id B6E57E5439 for ; Fri, 4 Jan 2013 04:25:27 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1357273515.628048d69acf0fda3adcf89793b1936ab70cad0e.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/locks.py X-VCS-Directories: pym/portage/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 628048d69acf0fda3adcf89793b1936ab70cad0e X-VCS-Branch: master Date: Fri, 4 Jan 2013 04:25:27 +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: ca9b3e66-67ae-44d3-8c19-6bf93054b8c0 X-Archives-Hash: 0654cf70339d5c308aad429521372ab9 commit: 628048d69acf0fda3adcf89793b1936ab70cad0e Author: Zac Medico gentoo org> AuthorDate: Fri Jan 4 04:25:15 2013 +0000 Commit: Zac Medico gentoo org> CommitDate: Fri Jan 4 04:25:15 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=628048d6 Enable FD_CLOEXEC for lock fd. --- pym/portage/locks.py | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/pym/portage/locks.py b/pym/portage/locks.py index 59fbc6e..ed9238d 100644 --- a/pym/portage/locks.py +++ b/pym/portage/locks.py @@ -1,5 +1,5 @@ # portage: Lock management code -# Copyright 2004-2012 Gentoo Foundation +# Copyright 2004-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 __all__ = ["lockdir", "unlockdir", "lockfile", "unlockfile", \ @@ -207,6 +207,15 @@ def lockfile(mypath, wantnewlockfile=0, unlinkfile=0, waiting_msg=waiting_msg, flags=flags) if myfd != HARDLINK_FD: + + try: + fcntl.FD_CLOEXEC + except AttributeError: + pass + else: + fcntl.fcntl(myfd, fcntl.F_SETFL, + fcntl.fcntl(myfd, fcntl.F_GETFL) | fcntl.FD_CLOEXEC) + _open_fds.add(myfd) writemsg(str((lockfilename,myfd,unlinkfile))+"\n",1)