X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fos.c;h=2b6f79c3fab66a24e121bb734e4194b0a5047d81;hb=805c9d531fcf74099459cc57e520a59b472e0de5;hp=a70bc61158a34e08a2fa1e8cd3540529b3b1ec76;hpb=5bfb4cdf352ad40304c6bbf0d826569dea761699;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/os.c b/src/src/os.c index a70bc6115..2b6f79c3f 100644 --- a/src/src/os.c +++ b/src/src/os.c @@ -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 @@ -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 +# include + +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 + +/* ----------------------------------------------------------------------- */ +