summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-05-04 13:41:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:51:45 -0500
commit2c367686fcff32a45c0af84225a8b47d95149e18 (patch)
treea11feded021691b93b2f730b41495fe87424b035
parent6a8355a6282563e3198c05dd6eb82107e449682c (diff)
downloadsamba-2c367686fcff32a45c0af84225a8b47d95149e18.tar.gz
samba-2c367686fcff32a45c0af84225a8b47d95149e18.tar.bz2
samba-2c367686fcff32a45c0af84225a8b47d95149e18.zip
r468: fixed timegm() on broken systems
(This used to be commit a3d639d04ff25deabd299ea24917adde9192ed38)
-rw-r--r--source4/lib/replace.c6
1 files changed, 5 insertions, 1 deletions
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;
}