[gnome-lirc-properties] Fix left-over irrecord processes



commit 94e4ae3de1c62dfd238e373d6e3f6ac56b374991
Author: Bastien Nocera <hadess hadess net>
Date:   Wed May 19 15:31:12 2010 +0100

    Fix left-over irrecord processes
    
    By killing both irrecord and its child, until irrecord is
    fixed to not leave dangling children all over:
    https://bugzilla.redhat.com/show_bug.cgi?id=593704

 gnome_lirc_properties/backend.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gnome_lirc_properties/backend.py b/gnome_lirc_properties/backend.py
index b6d5ff3..10aac3b 100644
--- a/gnome_lirc_properties/backend.py
+++ b/gnome_lirc_properties/backend.py
@@ -189,7 +189,11 @@ class ExternalToolDriver(PolicyKitService):
         try:
             if -1 != os.waitpid(self.__pid, os.P_NOWAIT):
                 print 'Terminating child process %d...' % self.__pid
-                os.kill(self.__pid, signal.SIGTERM)
+                # Kill irrecord and its children and wait for left-overs
+                # FIXME use self.__pid not -self.__pid when irrecord is fixed
+                # https://bugzilla.redhat.com/show_bug.cgi?id=593704
+                os.kill(-self.__pid, signal.SIGTERM)
+                os.waitpid(self.__pid, os.P_WAIT)
 
         except OSError, ex:
             if ex.errno != errno.ESRCH:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]