]> git.netwichtig.de Git - user/henk/code/exim.git/blobdiff - src/src/os.c
Fix dnssec indication variable when used from smtp:commect event
[user/henk/code/exim.git] / src / src / os.c
index a70bc61158a34e08a2fa1e8cd3540529b3b1ec76..2b6f79c3fab66a24e121bb734e4194b0a5047d81 100644 (file)
@@ -2,7 +2,7 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2009 */
+/* Copyright (c) University of Cambridge 1995 - 2012 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 #ifdef STAND_ALONE
@@ -807,7 +807,7 @@ directly, instead making you call a function per thread to get a handle.
 Other OSs handle thread-safe resolver differently, in ways which fail if the
 programmer creates their own structs. */
 
-#ifndef OS_GET_DNS_RESOLVER_RES
+#if !defined(OS_GET_DNS_RESOLVER_RES) && !defined(COMPILE_UTILITY)
 
 #include <resolv.h>
 
@@ -836,6 +836,39 @@ os_get_dns_resolver_res(void)
 
 /* ----------------------------------------------------------------------- */
 
+/***********************************************************
+*                 Time-related functions                   *
+***********************************************************/
+
+/* At least Solaris, and probably others, don't have this */
+
+#ifndef _BSD_SOURCE
+
+# include <time.h>
+# include <stdlib.h>
+
+time_t
+timegm(struct tm * tm)
+{
+time_t ret;
+char *tz;
+
+tz = getenv("TZ");
+setenv("TZ", "", 1);
+tzset();
+ret = mktime(tm);
+if (tz)
+  setenv("TZ", tz, 1);
+else
+  unsetenv("TZ");
+tzset();
+return ret;
+}
+
+#endif
+
+/* ----------------------------------------------------------------------- */
+