summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev_d.c8
-rw-r--r--namedev.c5
2 files changed, 7 insertions, 6 deletions
diff --git a/dev_d.c b/dev_d.c
index c091f11c28..eaf9b1dc12 100644
--- a/dev_d.c
+++ b/dev_d.c
@@ -39,6 +39,7 @@ static int run_program(char *name)
{
pid_t pid;
int fd;
+ char *argv[3];
dbg("running %s", name);
@@ -54,7 +55,12 @@ static int run_program(char *name)
dup2(fd, STDERR_FILENO);
}
close(fd);
- execv(name, main_argv);
+
+ argv[0] = name;
+ argv[1] = main_argv[1];
+ argv[2] = NULL;
+
+ execv(name, argv);
dbg("exec of child failed");
exit(1);
case -1:
diff --git a/namedev.c b/namedev.c
index 3843d02869..695fb55413 100644
--- a/namedev.c
+++ b/namedev.c
@@ -450,11 +450,6 @@ static int execute_program(const char *path, char *value, int len)
dbg("execute '%s' with subsystem '%s' argument", arg, argv[1]);
}
- /* set basename() only */
- pos = strrchr(argv[0], '/');
- if (pos != NULL)
- argv[0] = &pos[1];
-
retval = pipe(fds);
if (retval != 0) {
dbg("pipe failed");