[PATCH xoo 4/8] Fix execl call
Yaakov (Cygwin/X)
yselkowitz at users.sourceforge.net
Wed Oct 10 16:06:59 PDT 2012
From: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
"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 at users.sourceforge.net>
---
src/callbacks.c | 6 ++++--
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);
--
1.7.9
More information about the xorg-devel
mailing list