From 1059b07a143fac796a4ae8a7235cab9665a7622e Mon Sep 17 00:00:00 2001 From: "kay.sievers@vrfy.org" Date: Thu, 7 Oct 2004 00:17:11 -0700 Subject: [PATCH] fix problems with dev.d and udevstart Here is the correction for the dev.d/ scripts too. We should pass the right argv[0] here too. A script may depend on the right value, as udev does with udev/udevstart. Here is the old version: [pid 4692] execve("/etc/dev.d/default/log.dev", ["./udev", "block"], [/* 41 vars */]) = 0 this the new one: [pid 9832] execve("/etc/dev.d/default/log.dev", ["/etc/dev.d/default/log.dev", "block"], [/* 41 vars */]) = 0 --- dev_d.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'dev_d.c') 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: -- cgit v1.2.3-54-g00ecf