summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2002-10-30 18:18:25 +0000
committerJim McDonough <jmcd@samba.org>2002-10-30 18:18:25 +0000
commitb1598ff699b74cd2cd5db4af8e225456a1c8bdef (patch)
tree2fbbb3e2b4d0499c844e6db3f58d79c6f755631e /source3/lib
parent9dcba819338e9abb45162fb7d534df80390c624e (diff)
downloadsamba-b1598ff699b74cd2cd5db4af8e225456a1c8bdef.tar.gz
samba-b1598ff699b74cd2cd5db4af8e225456a1c8bdef.tar.bz2
samba-b1598ff699b74cd2cd5db4af8e225456a1c8bdef.zip
Fix build. Don't use BSD setenv. Use POSIX putenv.
Jeremy, it wasn't me!!!!!! (This used to be commit 00d4e5c67b8a3b8eafa56fd46fbaf4922030dd81)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/replace.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/lib/replace.c b/source3/lib/replace.c
index afdf32dbe8..dfc88e7028 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;