]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Export the parent pid to the script.
authorRoy Marples <roy@marples.name>
Wed, 14 May 2008 11:44:01 +0000 (11:44 +0000)
committerRoy Marples <roy@marples.name>
Wed, 14 May 2008 11:44:01 +0000 (11:44 +0000)
configure.c
dhcpcd.sh.in

index 2db4397889709322216a38ec8788953f3c41dec3..cd241dfc3eca273e787c4ec508fe1664a9a571f0 100644 (file)
@@ -65,7 +65,7 @@ exec_script(const char *script, const char *iface, const char *reason,
        logger(LOG_DEBUG, "exec `%s'", script);
 
        /* Make our env */
-       elen = 3;
+       elen = 4;
        env = xmalloc(sizeof(char *) * (elen + 1));
        path = getenv("PATH");
        if (path) {
@@ -80,6 +80,9 @@ exec_script(const char *script, const char *iface, const char *reason,
        e = strlen("reason") + strlen(reason) + 2;
        env[2] = xmalloc(e);
        snprintf(env[2], e, "reason=%s", reason);
+       e = 20;
+       env[3] = xmalloc(e);
+       snprintf(env[3], e, "pid=%d", getpid());
        if (dhcpo) {
                e = configure_env(NULL, NULL, dhcpo);
                if (e > 0) {
index c5df4e77d8b49135aa02712e8beb73c317cede5c..7e080254351f1d71a609caf36bc1a3349f0c5d03 100644 (file)
@@ -104,7 +104,7 @@ set_hostname()
 
 run_test()
 {
-       env | grep "^\(interface\|reason\)="
+       env | grep "^\(interface\|pid\|reason\)="
        env | grep "^\(new_\|old_\)" | sort
 }