Commit 3b10c0c3 authored by Hye-Shik Chang's avatar Hye-Shik Chang

Make _spawn_posix be ready for EINTR. waitpid(2) can be interrupted

by SIGCHLD or sth because no signal is masked before. This fixes
an optimized installation problem on FreeBSD libpthread.
parent 6641385c
...@@ -144,7 +144,14 @@ def _spawn_posix (cmd, ...@@ -144,7 +144,14 @@ def _spawn_posix (cmd,
# Loop until the child either exits or is terminated by a signal # Loop until the child either exits or is terminated by a signal
# (ie. keep waiting if it's merely stopped) # (ie. keep waiting if it's merely stopped)
while 1: while 1:
(pid, status) = os.waitpid(pid, 0) try:
(pid, status) = os.waitpid(pid, 0)
except OSError, exc:
import errno
if exc.errno == errno.EINTR:
continue
raise DistutilsExecError, \
"command '%s' failed: %s" % (cmd[0], exc[-1])
if os.WIFSIGNALED(status): if os.WIFSIGNALED(status):
raise DistutilsExecError, \ raise DistutilsExecError, \
"command '%s' terminated by signal %d" % \ "command '%s' terminated by signal %d" % \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment