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 3AFD0138010 for ; Mon, 8 Oct 2012 13:49:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A9331E00B2; Mon, 8 Oct 2012 13:49:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 33554E00B2 for ; Mon, 8 Oct 2012 13:49:13 +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 98C8733C2F0 for ; Mon, 8 Oct 2012 13:49:12 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 4464CE5436 for ; Mon, 8 Oct 2012 13:49:11 +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: <1349704135.70f580e22e82dc26831cd759c56501c72a8db00f.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/util/_async/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/util/_async/ForkProcess.py X-VCS-Directories: pym/portage/util/_async/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 70f580e22e82dc26831cd759c56501c72a8db00f X-VCS-Branch: master Date: Mon, 8 Oct 2012 13:49:11 +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: d0d673bb-41c0-451c-82eb-910508573fea X-Archives-Hash: 40b1065a69480978159f7a85ef62d74c commit: 70f580e22e82dc26831cd759c56501c72a8db00f Author: Zac Medico gentoo org> AuthorDate: Mon Oct 8 13:48:55 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Oct 8 13:48:55 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=70f580e2 ForkProcess: increase scope of try/finally/_exit This minimizes the probability of triggering irrelevant finally blocks from earlier in the call stack (bug #345289). --- pym/portage/util/_async/ForkProcess.py | 20 +++++++++++--------- 1 files changed, 11 insertions(+), 9 deletions(-) diff --git a/pym/portage/util/_async/ForkProcess.py b/pym/portage/util/_async/ForkProcess.py index 6fcd662..96ce3d9 100644 --- a/pym/portage/util/_async/ForkProcess.py +++ b/pym/portage/util/_async/ForkProcess.py @@ -25,17 +25,19 @@ class ForkProcess(SpawnProcess): portage.process.spawned_pids.append(pid) return [pid] - portage.locks._close_fds() - # Disable close_fds since we don't exec (see _setup_pipes docstring). - portage.process._setup_pipes(fd_pipes, close_fds=False) - - # Use default signal handlers in order to avoid problems - # killing subprocesses as reported in bug #353239. - signal.signal(signal.SIGINT, signal.SIG_DFL) - signal.signal(signal.SIGTERM, signal.SIG_DFL) - rval = 1 try: + + # Use default signal handlers in order to avoid problems + # killing subprocesses as reported in bug #353239. + signal.signal(signal.SIGINT, signal.SIG_DFL) + signal.signal(signal.SIGTERM, signal.SIG_DFL) + + portage.locks._close_fds() + # We don't exec, so use close_fds=False + # (see _setup_pipes docstring). + portage.process._setup_pipes(fd_pipes, close_fds=False) + rval = self._run() except SystemExit: raise