diff options
Diffstat (limited to 'source3/lib/replace.c')
-rw-r--r-- | source3/lib/replace.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source3/lib/replace.c b/source3/lib/replace.c index fd7b2cf7f0..afdf32dbe8 100644 --- a/source3/lib/replace.c +++ b/source3/lib/replace.c @@ -430,3 +430,25 @@ 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; + + tz = getenv("TZ"); + setenv("TZ", "", 1); + tzset(); + ret = mktime(tm); + if (tz) { + setenv("TZ", tz, 1); + } else { + unsetenv("TZ"); + } + tzset(); + return ret; +} +#endif |