diff options
-rw-r--r-- | 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 1ee5b9ae6..47b0a2147 100644 --- a/pym/portage/process.py +++ b/pym/portage/process.py @@ -244,7 +244,7 @@ def spawn(mycommand, env={}, opt_name=None, fd_pipes=None, returnpid=False, pid = os.fork() - if not pid: + if pid == 0: try: _exec(binary, mycommand, opt_name, fd_pipes, env, gid, groups, uid, umask, pre_exec) @@ -259,6 +259,9 @@ def spawn(mycommand, env={}, opt_name=None, fd_pipes=None, returnpid=False, sys.stderr.flush() os._exit(1) + 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) |