summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Bachmann <manuel.bachmann@open.eurogiciel.org>2014-04-15 16:10:58 +0200
committerManuel Bachmann <manuel.bachmann@open.eurogiciel.org>2014-04-15 16:13:13 +0200
commitd1ca611c57b3243e9649d1b2b5902515fba31226 (patch)
tree1463232e9fab28b7f6ea49ae1255cef315003505
parentb5a630548ac6fc8bbf24213b40eea772017af53b (diff)
downloadweston-common-d1ca611c57b3243e9649d1b2b5902515fba31226.tar.gz
weston-common-d1ca611c57b3243e9649d1b2b5902515fba31226.tar.bz2
weston-common-d1ca611c57b3243e9649d1b2b5902515fba31226.zip
tz-launcher: use exec() instead of system(), so SIGs can be catched normally.
Change-Id: If5929361704bbd7bcc531f7c692b51c05c59a2c9 Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
-rw-r--r--tz-launcher/tz-launcher-wl.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/tz-launcher/tz-launcher-wl.c b/tz-launcher/tz-launcher-wl.c
index 1213717..9e3dd74 100644
--- a/tz-launcher/tz-launcher-wl.c
+++ b/tz-launcher/tz-launcher-wl.c
@@ -183,9 +183,11 @@ launcher_button_handler(struct widget *widget,
widget_schedule_redraw (widget);
if (state == WL_POINTER_BUTTON_STATE_RELEASED) {
- gchar *command = g_strconcat (launcher->exec, " &", NULL);
- system (command);
- g_free (command);
+ if (fork () == 0) {
+ gchar **command = g_strsplit (launcher->exec, " ", 0);
+ execvp (command[0], command);
+ g_strfreev (command);
+ }
}
}
@@ -199,9 +201,11 @@ launcher_touch_up_handler(struct widget *widget, struct input *input,
launcher->focused = 0;
widget_schedule_redraw(widget);
- gchar *command = g_strconcat (launcher->exec, " &", NULL);
- system (command);
- g_free (command);
+ if (fork () == 0) {
+ gchar **command = g_strsplit (launcher->exec, " ", 0);
+ execvp (command[0], command);
+ g_strfreev (command);
+ }
}
static void