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:
@@ -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
|
||||
|
Reference in New Issue
Block a user