Commit 97b10a00 authored by Colin Walters's avatar Colin Walters

lockfile: Don't throw on stale lock files

If we read a lock file but the process has exited, gracefully handle
parent 545d9b07
......@@ -64,7 +64,10 @@ class SymlinkLockFile(LockFile):
def _existing_process_matches(self, pid, uid):
if os.uname()[0] != 'Linux':
return os.path.exists('/proc/%d' % (pid, ))
f = open('/proc/%d/status' % (pid, ))
f = open('/proc/%d/status' % (pid, ))
except IOError, e:
return False
for line in f:
if line.startswith('Uid:'):
(real, rest) = line[4:].split(None, 1)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment