From: Aurélien Reynaud Date: Thu, 29 Apr 2010 07:37:57 +0000 (+0200) Subject: Solaris 8 fixes: Fall back to putenv(3). X-Git-Tag: collectd-4.10.0~3^2~2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7fc9c92bd22bf69bdf4b6b85ce6f2dc692ff0869;p=collectd.git Solaris 8 fixes: Fall back to putenv(3). --- diff --git a/configure.in b/configure.in index efb1e24c..0a6d25f0 100644 --- a/configure.in +++ b/configure.in @@ -477,7 +477,7 @@ AC_HEADER_TIME # 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 681b94d6..c64f949f 100644 --- a/src/exec.c +++ b/src/exec.c @@ -269,11 +269,23 @@ static void set_environment (void) /* {{{ */ { 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))