aboutsummaryrefslogtreecommitdiff
path: root/python/ovs/daemon.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/ovs/daemon.py')
-rw-r--r--python/ovs/daemon.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/python/ovs/daemon.py b/python/ovs/daemon.py
index 5937877c..0d119f20 100644
--- a/python/ovs/daemon.py
+++ b/python/ovs/daemon.py
@@ -245,13 +245,19 @@ def _fork_and_wait_for_startup():
break
if len(s) != 1:
retval, status = _waitpid(pid, 0)
- if (retval == pid and
- os.WIFEXITED(status) and os.WEXITSTATUS(status)):
- # Child exited with an error. Convey the same error to
- # our parent process as a courtesy.
- sys.exit(os.WEXITSTATUS(status))
+ if retval == pid:
+ if os.WIFEXITED(status) and os.WEXITSTATUS(status):
+ # Child exited with an error. Convey the same error to
+ # our parent process as a courtesy.
+ sys.exit(os.WEXITSTATUS(status))
+ else:
+ sys.stderr.write("fork child failed to signal "
+ "startup (%s)\n"
+ % ovs.process.status_msg(status))
else:
- sys.stderr.write("fork child failed to signal startup\n")
+ assert retval < 0
+ sys.stderr.write("waitpid failed (%s)\n"
+ % os.strerror(-retval))
sys.exit(1)
os.close(rfd)