SVN: wireless-net/trunk/sysconfig/interfaces/up.d/ppp/wlan-up.py

arekm arekm at pld-linux.org
Tue Nov 7 10:00:13 CET 2006


Author: arekm
Date: Tue Nov  7 10:00:13 2006
New Revision: 7947

Modified:
   wireless-net/trunk/sysconfig/interfaces/up.d/ppp/wlan-up.py
Log:
len() on int isn't good idea.

Modified: wireless-net/trunk/sysconfig/interfaces/up.d/ppp/wlan-up.py
==============================================================================
--- wireless-net/trunk/sysconfig/interfaces/up.d/ppp/wlan-up.py	(original)
+++ wireless-net/trunk/sysconfig/interfaces/up.d/ppp/wlan-up.py	Tue Nov  7 10:00:13 2006
@@ -19,18 +19,19 @@
     pid = fp_pid.readline()
     fp_pid.close()
     pid = int(pid)
-    if len(pid) and pid > 0:
+    if pid > 0:
         return pid
     return False
 
 def kill_pid(pid):
-    if len(pid) and pid > 0 and pid_exists(pid):
+    pid = int(pid)
+    if pid > 0 and pid_exists(pid):
         try:
             os.kill(pid, signal.SIGTERM)
         except OSError, e:
             fl.write("%s: unable to SIGTERM: %s [pid=%d]\n" % (time.asctime(time.gmtime()), e, pid))
             pass
-        for i in [1, 2, 3, 4, 5, 6, 7, 8]:
+        for i in range(10):
             if not pid_exists(pid):
                 break
             time.sleep(1)


More information about the pld-cvs-commit mailing list