aboutsummaryrefslogtreecommitdiffstats
path: root/plugin_button_exec.c
diff options
context:
space:
mode:
authormichux <michux@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2008-11-22 23:46:47 +0000
committermichux <michux@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2008-11-22 23:46:47 +0000
commit5162ea943ae34684aacdb8fe29da91e6a974979e (patch)
treede95f09d2f097e57bfd8cf87b0b3e78033d9dabd /plugin_button_exec.c
parent98870dbee74445b3d7de7468fccdb3ef4d6d2ff2 (diff)
downloadlcd4linux-5162ea943ae34684aacdb8fe29da91e6a974979e.tar.gz
update button_exec plugin - fix segfault
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@901 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'plugin_button_exec.c')
-rw-r--r--plugin_button_exec.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/plugin_button_exec.c b/plugin_button_exec.c
index a8f432b..118ab11 100644
--- a/plugin_button_exec.c
+++ b/plugin_button_exec.c
@@ -64,7 +64,6 @@ static void my_button_exec(RESULT * result, int argc, RESULT * argv[])
char *args[argc + 1];
char *arg;
char *prog;
- char *env[1];
signal(SIGCHLD, SIG_IGN);
prog = R2S(argv[0]);
@@ -74,13 +73,13 @@ static void my_button_exec(RESULT * result, int argc, RESULT * argv[])
args[i] = arg;
info(arg);
}
+ args[0] = prog;
args[i] = (char *) 0;
- env[0] = (char *) 0;
pid = fork();
if (pid == 0) { /* child-process */
/* char *args[] = {"-r", "-t", "-l", (char *) 0 }; */
info("executing program");
- execve(prog, args, env);
+ execvp(prog, args);
errsv = errno;
info("executing program failed");
info(strerror(errsv));