Bug 534934 - mochitest-ipcplugins: OSError: [Errno 10] No child process, r=bsmedberg

This commit is contained in:
Jonathan Griffin 2009-12-15 20:21:51 -05:00
Родитель 63b57abda9
Коммит 2fe20f5e48
1 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -526,15 +526,17 @@ else:
# The method throws OSError if the PID is invalid, which we catch below. # The method throws OSError if the PID is invalid, which we catch below.
os.kill(pid, 0) os.kill(pid, 0)
# wait on it to see if it's a zombie # Wait on it to see if it's a zombie. This can throw OSError.ECHILD if
# the process terminates before we get to this point.
wpid, wstatus = os.waitpid(pid, os.WNOHANG) wpid, wstatus = os.waitpid(pid, os.WNOHANG)
if wpid == 0: if wpid == 0:
return True return True
return False return False
except OSError, err: except OSError, err:
# Catch the one error we expect from os.kill, and re-raise any others # Catch the errors we might expect from os.kill/os.waitpid,
if err.errno == errno.ESRCH: # and re-raise any others
if err.errno == errno.ESRCH or err.errno == errno.ECHILD:
return False return False
raise raise