From 2c367686fcff32a45c0af84225a8b47d95149e18 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 4 May 2004 13:41:08 +0000 Subject: r468: fixed timegm() on broken systems (This used to be commit a3d639d04ff25deabd299ea24917adde9192ed38) --- source4/lib/replace.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source4') diff --git a/source4/lib/replace.c b/source4/lib/replace.c index cde9ce7a1b..d0de601079 100644 --- a/source4/lib/replace.c +++ b/source4/lib/replace.c @@ -437,6 +437,7 @@ char *rep_inet_ntoa(struct in_addr ip) { struct tm tm2, tm3; time_t t; + static int zone = -1; tm2 = *tm; @@ -445,7 +446,10 @@ char *rep_inet_ntoa(struct in_addr ip) tm2 = *tm; tm2.tm_isdst = tm3.tm_isdst; t = mktime(&tm2); - t -= TimeDiff(); + if (zone == -1) { + zone = get_time_zone(); + } + t -= zone; return t; } -- cgit