From: Zac Medico Date: Fri, 11 Jul 2008 22:40:26 +0000 (-0000) Subject: Fix SpawnProcess.start() to return early and notify exit listeners if the X-Git-Tag: v2.2_rc2~126 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ff7eec97cc23032533c14518055cd71387ec3ca2;p=portage.git Fix SpawnProcess.start() to return early and notify exit listeners if the spawn call fails. svn path=/main/trunk/; revision=11019 --- diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index bde6d5cbe..ff5c3d585 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -1861,10 +1861,19 @@ class SpawnProcess(SubProcess): retval = portage.process.spawn(self.args, **kwargs) + os.close(slave_fd) + + if isinstance(retval, int): + # spawn failed + os.close(master_fd) + self.returncode = retval + self.wait() + return + self.pid = retval[0] portage.process.spawned_pids.remove(self.pid) - os.close(slave_fd) + files.process = os.fdopen(master_fd, 'r') self._reg_id = self.scheduler.register(files.process.fileno(), PollConstants.POLLIN, output_handler)