diff options
Diffstat (limited to 'source3/lib/replace.c')
-rw-r--r-- | source3/lib/replace.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/lib/replace.c b/source3/lib/replace.c index afdf32dbe88..dfc88e70281 100644 --- a/source3/lib/replace.c +++ b/source3/lib/replace.c @@ -438,15 +438,18 @@ char *rep_inet_ntoa(struct in_addr ip) { time_t ret; char *tz; + char *tzvar; tz = getenv("TZ"); - setenv("TZ", "", 1); + putenv("TZ="); tzset(); ret = mktime(tm); if (tz) { - setenv("TZ", tz, 1); + asprintf(&tzvar, "TZ=%s", tz); + putenv(tzvar); + safe_free(tzvar); } else { - unsetenv("TZ"); + putenv("TZ"); } tzset(); return ret; |