summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-10-20 06:51:21 +0000
committerAndrew Tridgell <tridge@samba.org>1998-10-20 06:51:21 +0000
commit26b299dd528348b97e2db90660b52d664a1d716a (patch)
tree070414824745a276951306d5bb1d51a4fbc7db96
parente4678f5d1de6d2bddb7dd33e9361e1eafbf61d6c (diff)
downloadsamba-26b299dd528348b97e2db90660b52d664a1d716a.tar.gz
samba-26b299dd528348b97e2db90660b52d664a1d716a.tar.bz2
samba-26b299dd528348b97e2db90660b52d664a1d716a.zip
use putenv() more portably
(This used to be commit dc08f1a5c92e86c41dc03f6a4d10d5779f3d9c34)
-rw-r--r--source3/smbwrapper/shared.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/smbwrapper/shared.c b/source3/smbwrapper/shared.c
index 3e6e19d9d1..52ed9baac8 100644
--- a/source3/smbwrapper/shared.c
+++ b/source3/smbwrapper/shared.c
@@ -139,6 +139,7 @@ char *smbw_getshared(const char *name)
failed:
DEBUG(0,("smbw: shared variables corrupt (%s)\n", strerror(errno)));
exit(1);
+ return NULL;
}
@@ -185,9 +186,14 @@ set an env variable - some systems don't have this
int smbw_setenv(const char *name, const char *value)
{
pstring s;
+ char *p;
slprintf(s,sizeof(s)-1,"%s=%s", name, value);
- return putenv(s);
+ p = strdup(s);
+
+ if (p) p = putenv(p);
+
+ return p;
}