summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 82882bc)
raw | patch | inline | side by side (parent: 82882bc)
author | Aurélien Reynaud <collectd@wattapower.net> | |
Thu, 29 Apr 2010 07:37:57 +0000 (09:37 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Thu, 29 Apr 2010 07:42:34 +0000 (09:42 +0200) |
configure.in | patch | blob | history | |
src/exec.c | patch | blob | history |
diff --git a/configure.in b/configure.in
index efb1e24c1e47613d0ba47bbe23bb0dd1aac93ba6..0a6d25f08f41a3752d8e50f5c237fc8025935638 100644 (file)
--- a/configure.in
+++ b/configure.in
# Checks for library functions.
#
AC_PROG_GCC_TRADITIONAL
-AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf)
+AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv)
AC_FUNC_STRERROR_R
diff --git a/src/exec.c b/src/exec.c
index 681b94d67c8b28a334b74c1078389540aacdc570..c64f949fc57b4ac5cff424a6b27e7cd283e13184 100644 (file)
--- a/src/exec.c
+++ b/src/exec.c
{
char buffer[1024];
+#ifdef HAVE_SETENV
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);
+#else
+ ssnprintf (buffer, sizeof (buffer), "COLLECTD_INTERVAL=%i", interval_g);
+ putenv (buffer);
+
+ ssnprintf (buffer, sizeof (buffer), "COLLECTD_HOSTNAME=%s", hostname_g);
+ putenv (buffer);
+#endif
+
+#ifdef HAVE_SETENV
+#else
+#endif
} /* }}} void set_environment */
__attribute__((noreturn))