Skip to content
Snippets Groups Projects
Commit 67d9e4d4 authored by junglecow's avatar junglecow
Browse files

Forgot to close pidfile when /proc doesn't exist. Fixed.

parent c69061b4
No related branches found
No related tags found
No related merge requests found
......@@ -150,22 +150,19 @@ import errno
import dialogs
def pid_alive():
if os.name == 'nt':
if os.path.exists(pid_filename):
return True
return False
return os.path.exists(pid_filename):
try:
pf = open(pid_filename)
except:
# probably file not found
return False
if not os.path.exists('/proc'):
return True # no /proc, assume Gajim is running
try:
pid = int(pf.read().strip())
pf.close()
if not os.path.exists('/proc'):
return True # no /proc, assume Gajim is running
try:
f = open('/proc/%d/cmdline'% pid)
except IOError, e:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment