summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaakov Selkowitz <yselkowitz@users.sourceforge.net>2012-10-11 01:50:27 -0500
committerRoss Burton <ross.burton@intel.com>2012-10-11 12:48:26 +0100
commita9d55c87e7d94c3de9228ba8f71668c169b4146c (patch)
treed6bf2cc2759b2a22500c2de46c00b670caaae536
parentf561c844e07e4538709484367b9ff9af179b982a (diff)
Fix execl call
"xoo --device FILENAME" must be a single string when passed to sh -c, otherwise the arguments are lost. Also, use symbolic constant SIGKILL for portability. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
-rw-r--r--src/callbacks.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/callbacks.c b/src/callbacks.c
index e46314e..9cbdeb8 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -140,6 +140,7 @@ on_select_device (GtkMenuItem * menuitem, FakeApp * app)
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
{
+ char cmd[PATH_MAX + 13];
char *filename;
@@ -149,9 +150,10 @@ on_select_device (GtkMenuItem * menuitem, FakeApp * app)
/* xxx FIXME, This is gross - just a very nasty hack for now xxx */
- kill (xnest_pid, 9);
+ kill (xnest_pid, SIGKILL);
sleep (2);
- execl ("/bin/sh", "sh", "-c", "xoo", "--device", filename, NULL);
+ sprintf (cmd, "xoo --device %s", filename);
+ execl ("/bin/sh", "sh", "-c", cmd, NULL);
g_warning ("Failed load device %s\n", filename);