use putenv() more portably
authorAndrew Tridgell <tridge@samba.org>
Tue, 20 Oct 1998 06:51:21 +0000 (06:51 +0000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 20 Oct 1998 06:51:21 +0000 (06:51 +0000)
(This used to be commit dc08f1a5c92e86c41dc03f6a4d10d5779f3d9c34)

source3/smbwrapper/shared.c

index 3e6e19d9d1674c8003477f6e6801edf63e49f5ba..52ed9baac801adb6fa7c08dae4374aa8b2a52e5e 100644 (file)
@@ -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;
 }