loop until we reap all terminated children.

This commit is contained in:
Oleksii Kliukin
2015-05-13 12:22:17 +02:00
parent 8ad751b661
commit 609a4b2fc6
+4 -1
View File
@@ -22,7 +22,10 @@ def sigterm_handler(signo, stack_frame):
# handle SIGCHILD, since we are the equivalent of the INIT process
def sigchld_handler(signo, stack_frame):
try:
os.waitpid(-1, os.WNOHANG)
while True:
ret = os.waitpid(-1, os.WNOHANG)
if ret == (0, 0):
break
except OSError:
pass