From: Zac Medico Date: Tue, 14 Feb 2012 23:39:57 +0000 (-0800) Subject: Assert that fork returns int for bug 403697. X-Git-Tag: v2.2.0_alpha87~36 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=11937db0fb2e25a30d855b084417f8d52547ff54;p=portage.git Assert that fork returns int for bug 403697. These cases should have been included with commit 6a94a074aa0475173a51f3f726377d4c407e986b. --- diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py index 6ad434129..c0175b3fb 100644 --- a/pym/_emerge/EbuildFetcher.py +++ b/pym/_emerge/EbuildFetcher.py @@ -164,6 +164,9 @@ class EbuildFetcher(SpawnProcess): pid = os.fork() if pid != 0: + if not isinstance(pid, int): + raise AssertionError( + "fork returned non-integer: %s" % (repr(pid),)) portage.process.spawned_pids.append(pid) return [pid] diff --git a/pym/portage/dbapi/_MergeProcess.py b/pym/portage/dbapi/_MergeProcess.py index cf5926529..1747a098b 100644 --- a/pym/portage/dbapi/_MergeProcess.py +++ b/pym/portage/dbapi/_MergeProcess.py @@ -129,6 +129,10 @@ class MergeProcess(SpawnProcess): pid = os.fork() if pid != 0: + if not isinstance(pid, int): + raise AssertionError( + "fork returned non-integer: %s" % (repr(pid),)) + os.close(elog_writer_fd) self._elog_reader_fd = elog_reader_fd self._buf = ""