summaryrefslogtreecommitdiffstats
path: root/configure.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-05-14 11:44:01 +0000
committerRoy Marples <roy@marples.name>2008-05-14 11:44:01 +0000
commitbf6c0cfe0c1fd556f3b9353e36346946d91cac55 (patch)
tree82d2d24ce00b43e1ba20c02ae3dfa22719ff311c /configure.c
parent34018b076149595d4c582327549a8f1b5e5ec4ba (diff)
downloaddhcpcd-bf6c0cfe0c1fd556f3b9353e36346946d91cac55.tar.xz
Export the parent pid to the script.
Diffstat (limited to 'configure.c')
-rw-r--r--configure.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/configure.c b/configure.c
index 2db43978..cd241dfc 100644
--- a/configure.c
+++ b/configure.c
@@ -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) {