summaryrefslogtreecommitdiff
path: root/source4/lib/replace
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/replace')
-rw-r--r--source4/lib/replace/replace.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/source4/lib/replace/replace.c b/source4/lib/replace/replace.c
index c53b5a5727..5e60252a67 100644
--- a/source4/lib/replace/replace.c
+++ b/source4/lib/replace/replace.c
@@ -369,18 +369,8 @@ duplicate a string
*/
time_t timegm(struct tm *tm)
{
- struct tm tm2, tm3;
- time_t t;
-
- tm2 = *tm;
-
- t = mktime(&tm2);
- tm3 = *localtime(&t);
- tm2 = *tm;
- tm2.tm_isdst = tm3.tm_isdst;
- t = mktime(&tm2);
- t -= get_time_zone(t);
-
+ time_t t = mktime(tm);
+ t -= mktime(gmtime(&t)) - (int)mktime(localtime(&t));
return t;
}
#endif