From dc5297f413c40f04e1fdae719e29d949e3301091 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 9 Nov 2002 16:57:45 +0000 Subject: Sync with HEAD (This used to be commit 1a25dc776ddc36de9a214e023becff1ceb10290c) --- source3/lib/replace.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'source3/lib/replace.c') diff --git a/source3/lib/replace.c b/source3/lib/replace.c index fd7b2cf7f0..dfc88e7028 100644 --- a/source3/lib/replace.c +++ b/source3/lib/replace.c @@ -430,3 +430,28 @@ char *rep_inet_ntoa(struct in_addr ip) #endif /* HAVE_VSYSLOG */ +#ifndef HAVE_TIMEGM +/* + see the timegm man page on linux +*/ + time_t timegm(struct tm *tm) +{ + time_t ret; + char *tz; + char *tzvar; + + tz = getenv("TZ"); + putenv("TZ="); + tzset(); + ret = mktime(tm); + if (tz) { + asprintf(&tzvar, "TZ=%s", tz); + putenv(tzvar); + safe_free(tzvar); + } else { + putenv("TZ"); + } + tzset(); + return ret; +} +#endif -- cgit