--- /dev/null
+/*************************************************
+* Exim - an Internet mail transport agent *
+*************************************************/
+
+/* Copyright (c) 2016 Heiko Schlittermann <hs@schlittermann.de> */
+/* See the file NOTICE for conditions of use and distribution. */
+
+/* BSDI-specific code. This is concatenated onto the generic
+src/os.c file. */
+
+#ifndef OS_UNSETENV
+#define OS_UNSETENV
+
+int
+os_unsetenv(const char *name)
+{
+ unsetenv(name);
+ return 0;
+}
#define HAVE_MMAP
#define HAVE_SYS_MOUNT_H
#define SIOCGIFCONF_GIVES_ADDR
+#define OS_UNSETENV
typedef struct flock flock_t;
uschar *name = string_copyn(*p, eqp - *p);
if (OK != match_isinlist(name, CUSS &keep_environment,
0, NULL, NULL, MCL_NOEXPAND, FALSE, NULL))
- if (unsetenv(CS name) < 0) return FALSE;
+ if (os_unsetenv(name) < 0) return FALSE;
else p = USS environ; /* RESTART from the beginning */
else p++;
store_reset(name);
#endif /* OS_GET_DNS_RESOLVER_RES */
-
/* ----------------------------------------------------------------------- */
+/***********************************************************
+* unsetenv() *
+***********************************************************/
+
+/* Most modern systems define int unsetenv(const char*),
+* some don't. */
+
+#if !defined(OS_UNSETENV)
+int
+os_unsetenv(const char *name)
+{
+ return unsetenv(name);
+}
+#endif
+
+
+/* ----------------------------------------------------------------------- */
#ifndef os_strsignal
extern const char *os_strsignal(int); /* char to match strsignal in some OS */
#endif
+#ifndef os_unsetenv
+extern int os_unsetenv(const char *);
+#endif
/* End of osfunctions.h */
{
uschar * old = US getenv("TZ");
(void) setenv("TZ", CCS tz, 1);
-tzset();
+tzset();
return old;
}
if (tz)
(void) setenv("TZ", CCS tz, 1);
else
- (void) unsetenv("TZ");
-tzset();
+ (void) os_unsetenv("TZ");
+tzset();
}
/*************************************************