From 67d9e4d40935e2196ee47874f86990dee5b0f3f1 Mon Sep 17 00:00:00 2001
From: junglecow <junglecow@no-mail.com>
Date: Wed, 22 Nov 2006 23:27:54 +0000
Subject: [PATCH] Forgot to close pidfile when /proc doesn't exist. Fixed.

---
 src/gajim.py | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/gajim.py b/src/gajim.py
index 34849a0722..1d5ad2d68f 100755
--- a/src/gajim.py
+++ b/src/gajim.py
@@ -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:
-- 
GitLab