aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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));