Forgot to close pidfile when /proc doesn't exist. Fixed.
This commit is contained in:
parent
c69061b41c
commit
67d9e4d409
13
src/gajim.py
13
src/gajim.py
|
@ -150,22 +150,19 @@ import errno
|
||||||
import dialogs
|
import dialogs
|
||||||
def pid_alive():
|
def pid_alive():
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
if os.path.exists(pid_filename):
|
return os.path.exists(pid_filename):
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
pf = open(pid_filename)
|
pf = open(pid_filename)
|
||||||
except:
|
except:
|
||||||
# probably file not found
|
# probably file not found
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if not os.path.exists('/proc'):
|
|
||||||
return True # no /proc, assume Gajim is running
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
pid = int(pf.read().strip())
|
pid = int(pf.read().strip())
|
||||||
pf.close()
|
pf.close()
|
||||||
|
|
||||||
|
if not os.path.exists('/proc'):
|
||||||
|
return True # no /proc, assume Gajim is running
|
||||||
|
|
||||||
try:
|
try:
|
||||||
f = open('/proc/%d/cmdline'% pid)
|
f = open('/proc/%d/cmdline'% pid)
|
||||||
except IOError, e:
|
except IOError, e:
|
||||||
|
|
Loading…
Reference in New Issue