summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Bachmann <manuel.bachmann@open.eurogiciel.org>2014-04-16 00:03:23 +0200
committerManuel Bachmann <manuel.bachmann@open.eurogiciel.org>2014-04-16 00:03:23 +0200
commite5c5c0d68f776722e6b410a694e85b770b85e7ba (patch)
tree16a8cdbb09f72557ae0f2b86b15fae9f63ee6cb0
parentd1ca611c57b3243e9649d1b2b5902515fba31226 (diff)
downloadweston-common-e5c5c0d68f776722e6b410a694e85b770b85e7ba.tar.gz
weston-common-e5c5c0d68f776722e6b410a694e85b770b85e7ba.tar.bz2
weston-common-e5c5c0d68f776722e6b410a694e85b770b85e7ba.zip
tz-launcher: use waitpid() to track children and avoid zombies
Change-Id: I312c0278fcc49399b5dbf542b50be04371eb9cac Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
-rw-r--r--tz-launcher/tz-launcher-wl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tz-launcher/tz-launcher-wl.c b/tz-launcher/tz-launcher-wl.c
index 9e3dd74..b580367 100644
--- a/tz-launcher/tz-launcher-wl.c
+++ b/tz-launcher/tz-launcher-wl.c
@@ -174,6 +174,15 @@ load_icon (char *path)
}
static void
+sigchild_handler (int s)
+{
+ pid_t pid;
+
+ while (pid = waitpid (-1, NULL, WNOHANG), pid > 0)
+ g_printerr ("child %d exited\n", pid);
+}
+
+static void
launcher_button_handler(struct widget *widget,
struct input *input, uint32_t time,
uint32_t button,
@@ -459,6 +468,8 @@ tz_launcher_wl_run (int desktopfiles, gchar ***desktoptable)
return;
}
+ signal (SIGCHLD, sigchild_handler);
+
main_window_create (display, desktopfiles, desktoptable);
display_run (display);