aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormallum <mallum@b067294f-1dea-0310-9683-c47a78595994>2005-10-17 08:23:27 +0000
committermallum <mallum@b067294f-1dea-0310-9683-c47a78595994>2005-10-17 08:23:27 +0000
commit844b360d74f4ae6a1cc20cb32bb205c03c94ae2b (patch)
treecf81e1b14ce8c3260d685919c9525a4cc5a84c0e
parent86be892c776a531ef37982d67fdbb3af4bc1f9fd (diff)
downloadmb-applet-input-manager-master.tar.gz
mb-applet-input-manager-master.tar.bz2
mb-applet-input-manager-master.zip
Deal with zombiesHEADmaster
git-svn-id: https://svn.o-hand.com/repos/matchbox/trunk/mb-applet-input-manager@1263 b067294f-1dea-0310-9683-c47a78595994
-rw-r--r--ChangeLog5
-rw-r--r--mbinputmgr.c18
2 files changed, 23 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 9b1d276..a3a8429 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-10-17 Matthew Allum <mallum@openedhand.com>
+
+ * mbinputmgr.c: (selected_method_load), (mbinpmgr_init):
+ Deal with Zombies.
+
2005-05-23 mallum,,, <mallum@openedhand.com>
* mbinputmgr-tray.c: (button_callback), (xevent_callback):
diff --git a/mbinputmgr.c b/mbinputmgr.c
index 12a84ea..be98469 100644
--- a/mbinputmgr.c
+++ b/mbinputmgr.c
@@ -1,5 +1,21 @@
#include "mbinputmgr.h"
+void
+cleanup_children(int s)
+{
+ kill(-getpid(), 15); /* kill every one in our process group */
+ exit(0);
+}
+
+void
+install_signal_handlers(void)
+{
+ signal (SIGCHLD, SIG_IGN); /* kernel can deal with zombies */
+ signal (SIGINT, cleanup_children);
+ signal (SIGQUIT, cleanup_children);
+ signal (SIGTERM, cleanup_children);
+}
+
static void
fork_exec(MBInpmgrState *inpmgr, char *cmd)
{
@@ -98,6 +114,8 @@ mbinpmgr_init(void)
char orig_wd[256];
int i;
+ install_signal_handlers();
+
inpmgr = malloc(sizeof(MBInpmgrState));
memset(inpmgr,0,sizeof(MBInpmgrState));