Many were false-positives and ignorable, but it's worth fixing the
former class.
+JH/47 Fix build on HP-UX and older Solaris, which need (un)setenv now also
+ for the new environment-manipulation done at startup. Move the routines
+ from being local to tls.c to being global via the os.c file.
+
Exim version 4.86
std-crypto.o: $(HDRS) std-crypto.c
store.o: $(HDRS) store.c
string.o: $(HDRS) string.c
-tls.o: $(HDRS) tls.c setenv.c \
+tls.o: $(HDRS) tls.c \
tls-gnu.c tlscert-gnu.c \
tls-openssl.c tlscert-openssl.c
tod.o: $(HDRS) tod.c
DBMLIB=-lndbm
RANLIB=@true
+os.o: setenv.c
+
# End
XLFLAGS=-L$(X11)/lib -R$(X11)/lib
X11LIB=$(X11)/lib
+os.o: setenv.c
+
# End
--- /dev/null
+/*************************************************
+* Exim - an Internet mail transport agent *
+*************************************************/
+
+/* Copyright (c) University of Cambridge 2016 */
+/* Copyright (c) Jeremy Harris 2016 */
+/* See the file NOTICE for conditions of use and distribution. */
+
+/* HP-UX-specific code. This is concatenated onto the generic
+src/os.c file. */
+
+#include "setenv.c"
+
+/* End of os.c-SunHP-UX */
--- /dev/null
+/*************************************************
+* Exim - an Internet mail transport agent *
+*************************************************/
+
+/* Copyright (c) University of Cambridge 2016 */
+/* Copyright (c) Jeremy Harris 2016 */
+/* See the file NOTICE for conditions of use and distribution. */
+
+/* Solaris-specific code. This is concatenated onto the generic
+src/os.c file. */
+
+#ifdef MISSING_UNSETENV_3
+# include "setenv.c"
+#endif
+
+/* End of os.c-SunOS5 */
#define FSCALE 1.0
#define HAVE_SYS_STATVFS_H
-#define MISSING_UNSETENV_3
#define F_FREESP O_TRUNC
#define NEED_H_ERRNO 1
*************************************************/
/* Copyright (c) Michael Haardt 2015 */
-/* Copyright (c) Jeremy Harris 2015 */
+/* Copyright (c) Jeremy Harris 2015 - 2016 */
/* See the file NOTICE for conditions of use and distribution. */
/* This module provides (un)setenv routines for those environments
-lacking them in libraries. */
+lacking them in libraries. It is #include'd by OS/os.c-foo files. */
-static int
+int
setenv(const char * name, const char * val, int overwrite)
{
uschar * s;
return 0;
}
-static int
+int
unsetenv(const char *name)
{
size_t len;
* Timezone environment flipping *
*************************************************/
-#ifdef MISSING_UNSETENV_3
-# include "setenv.c"
-#endif
-
static uschar *
to_tz(uschar * tz)
{
- uschar * old = US getenv("TZ");
- (void) setenv("TZ", CCS tz, 1);
- tzset();
- return old;
+uschar * old = US getenv("TZ");
+(void) setenv("TZ", CCS tz, 1);
+tzset();
+return old;
}
+
static void
restore_tz(uschar * tz)
{
- if (tz)
- (void) setenv("TZ", CCS tz, 1);
- else
- (void) unsetenv("TZ");
- tzset();
+if (tz)
+ (void) setenv("TZ", CCS tz, 1);
+else
+ (void) unsetenv("TZ");
+tzset();
}
/*************************************************