diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2002-11-09 16:57:45 +0000 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2002-11-09 16:57:45 +0000 |
commit | 1a25dc776ddc36de9a214e023becff1ceb10290c (patch) | |
tree | 709677b7bbc9f49fcf407dc65e6e83323086ebb5 /source/lib/replace.c | |
parent | eac350e09f5cdcf1b6ec1a3b7cde2c9aa3268143 (diff) | |
download | samba-1a25dc776ddc36de9a214e023becff1ceb10290c.tar.gz samba-1a25dc776ddc36de9a214e023becff1ceb10290c.tar.xz samba-1a25dc776ddc36de9a214e023becff1ceb10290c.zip |
Sync with HEAD
Diffstat (limited to 'source/lib/replace.c')
-rw-r--r-- | source/lib/replace.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source/lib/replace.c b/source/lib/replace.c index fd7b2cf7f01..dfc88e70281 100644 --- a/source/lib/replace.c +++ b/source/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 |