summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 51d1731)
raw | patch | inline | side by side (parent: 51d1731)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 15 Sep 2009 13:18:40 +0000 (15:18 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 15 Sep 2009 13:18:40 +0000 (15:18 +0200) |
src/exec.c | patch | blob | history |
diff --git a/src/exec.c b/src/exec.c
index 4405985646fdf24d27e3ea25367e32965cb47ee7..bbd23df13b4d3f3afb8422d6b447aece3a5657cb 100644 (file)
--- a/src/exec.c
+++ b/src/exec.c
return (0);
} /* int exec_config }}} */
+static void set_environment (void) /* {{{ */
+{
+ char buffer[1024];
+
+ ssnprintf (buffer, sizeof (buffer), "%i", interval_g);
+ setenv ("COLLECTD_INTERVAL", buffer, /* overwrite = */ 1);
+
+ ssnprintf (buffer, sizeof (buffer), "%s", hostname_g);
+ setenv ("COLLECTD_HOSTNAME", buffer, /* overwrite = */ 1);
+} /* }}} void set_environment */
+
static void exec_child (program_list_t *pl) /* {{{ */
{
int status;
@@ -468,6 +479,7 @@ static int fork_child (program_list_t *pl, int *fd_in, int *fd_out, int *fd_err)
close (fd_pipe_err[1]);
}
+ set_environment ();
exec_child (pl);
/* does not return */
}