X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=python%2Fovs%2Fdaemon.py;h=184e7832fc264f8d0bf52dd2df8d56d7c5695a2b;hb=03a8a29eb87ef21d0e56c200ebe43878ef773d63;hp=5b9b06ac2d960c30c5ba6b523069c81477b0e2cb;hpb=591c20651f18b158294d0f0456c2cb92b4051031;p=openvswitch diff --git a/python/ovs/daemon.py b/python/ovs/daemon.py index 5b9b06ac..184e7832 100644 --- a/python/ovs/daemon.py +++ b/python/ovs/daemon.py @@ -457,13 +457,15 @@ def __read_pidfile(pidfile, delete_if_stale): # Someone else has the pidfile locked. try: try: - return int(file_handle.readline()) + error = int(file_handle.readline()) except IOError, e: logging.warning("%s: read: %s" % (pidfile, e.strerror)) - return -e.errno + error = -e.errno except ValueError: logging.warning("%s does not contain a pid" % pidfile) - return -errno.EINVAL + error = -errno.EINVAL + + return error finally: try: file_handle.close()