X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=python%2Fovs%2Fdaemon.py;h=650d2504034b6cced33c0e3d6f0f4e90861ff4f0;hb=1804d25a21dcdec83437ab1ebf9daf683d7e50da;hp=5937877c3e1e52cc8fca25555fa8210e2ab12be5;hpb=e44a6fe503ad639787ec2f8d1ee0710e63dacd81;p=openvswitch diff --git a/python/ovs/daemon.py b/python/ovs/daemon.py index 5937877c..650d2504 100644 --- a/python/ovs/daemon.py +++ b/python/ovs/daemon.py @@ -1,4 +1,4 @@ -# Copyright (c) 2010, 2011 Nicira Networks +# Copyright (c) 2010, 2011 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -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)