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 1RuSEo-00013y-4N for garchives@archives.gentoo.org; Mon, 06 Feb 2012 17:20:22 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 44E3CE0458; Mon, 6 Feb 2012 17:20:15 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 15A14E0458 for ; Mon, 6 Feb 2012 17:20:15 +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 8FDE11B4023 for ; Mon, 6 Feb 2012 17:20:14 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id D35D780043 for ; Mon, 6 Feb 2012 17:20:13 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <6a94a074aa0475173a51f3f726377d4c407e986b.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/process.py X-VCS-Directories: pym/portage/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 6a94a074aa0475173a51f3f726377d4c407e986b Date: Mon, 6 Feb 2012 17:20:13 +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: 5f4121c3-bf9f-425d-bea2-c9ecfe91b1d4 X-Archives-Hash: bae40edff170c9a7022e1141b1be78e1 commit: 6a94a074aa0475173a51f3f726377d4c407e986b Author: Zac Medico gentoo org> AuthorDate: Mon Feb 6 17:20:05 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Feb 6 17:20:05 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D6a94a074 spawn: assert that fork returns int type --- pym/portage/process.py | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/pym/portage/process.py b/pym/portage/process.py index 1ee5b9a..47b0a21 100644 --- a/pym/portage/process.py +++ b/pym/portage/process.py @@ -244,7 +244,7 @@ def spawn(mycommand, env=3D{}, opt_name=3DNone, fd_pi= pes=3DNone, returnpid=3DFalse, =20 pid =3D os.fork() =20 - if not pid: + if pid =3D=3D 0: try: _exec(binary, mycommand, opt_name, fd_pipes, env, gid, groups, uid, umask, pre_exec) @@ -259,6 +259,9 @@ def spawn(mycommand, env=3D{}, opt_name=3DNone, fd_pi= pes=3DNone, returnpid=3DFalse, sys.stderr.flush() os._exit(1) =20 + if not isinstance(pid, int): + raise AssertionError("fork returned non-integer: %s" % (repr(pid),)) + # Add the pid to our local and the global pid lists. mypids.append(pid) spawned_pids.append(pid)