Fixes compiling at least with Solaris 8.
--HG--
branch : HEAD
dnl * after -lsocket and -lnsl tests, inet_aton() may be in them
AC_CHECK_FUNCS(fcntl flock lockf inet_aton sigaction getpagesize madvise \
- strcasecmp stricmp vsyslog writev pread uname \
+ strcasecmp stricmp vsyslog writev pread uname unsetenv \
setrlimit setproctitle seteuid setreuid setegid setresgid \
strtoull strtoll strtouq strtoq \
setpriority quotactl getmntent kqueue kevent backtrace_symbols \
void env_remove(const char *name)
{
+#ifdef HAVE_UNSETENV
unsetenv(name);
+#else
+ extern char **environ;
+ unsigned int len;
+ char **envp;
+
+ len = strlen(name);
+ for (envp = environ; *envp != NULL; envp++) {
+ if (strncmp(name, *envp, len) == 0 &&
+ (*envp)[len] == '=') {
+ do {
+ envp[0] = envp[1];
+ } while (*++envp != NULL);
+ break;
+ }
+ }
+#endif
}
void env_clean(void)