2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 22:35:15 +00:00

daemon: Tolerate EINTR in fork_and_wait_for_startup().

It seems possible that a signal coming in at the wrong time could confuse
this code.  It's always best to loop on EINTR.
This commit is contained in:
Ben Pfaff
2011-03-31 09:36:10 -07:00
parent 279c9e0308
commit af9a144207
2 changed files with 11 additions and 5 deletions

View File

@@ -213,10 +213,15 @@ def _fork_and_wait_for_startup():
# Running in parent process.
os.close(wfd)
ovs.fatal_signal.fork()
try:
s = os.read(rfd, 1)
except OSError, e:
s = ""
while True:
try:
s = os.read(rfd, 1)
error = 0
except OSError, e:
s = ""
error = e.errno
if error != errno.EINTR:
break
if len(s) != 1:
retval, status = _waitpid(pid, 0)
if (retval == pid and