summaryrefslogtreecommitdiff
path: root/python/ovs/daemon.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/ovs/daemon.py')
-rw-r--r--python/ovs/daemon.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/python/ovs/daemon.py b/python/ovs/daemon.py
index 5b9b06ac2..184e7832f 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()