1
0
mirror of /repos/baseimage-docker.git synced 2026-02-27 17:41:59 +01:00

Fix a potential hang in my_init during shutdown

Thanks to SAPikachu. Closes GH-151.
This commit is contained in:
Hongli Lai (Phusion)
2015-07-15 17:35:45 +02:00
parent 23d0a30e59
commit 7425da2825
2 changed files with 5 additions and 1 deletions

View File

@@ -127,7 +127,10 @@ def waitpid_reap_other_children(pid):
status = None
while not done:
try:
this_pid, status = os.waitpid(-1, 0)
# https://github.com/phusion/baseimage-docker/issues/151#issuecomment-92660569
this_pid, status = os.waitpid(pid, os.WNOHANG)
if this_pid == 0:
this_pid, status = os.waitpid(-1, 0)
if this_pid == pid:
done = True
else: