This patch to libgo corrects the implementation of syscall.Setenv for
systems that do not have the setenv library call, but only have putenv.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu and
i386-sun-solaris2.9.  Committed to mainline and 4.7 branch.

Ian

diff -r 1ed95295e00b libgo/runtime/go-setenv.c
--- a/libgo/runtime/go-setenv.c	Wed Apr 25 21:25:31 2012 -0700
+++ b/libgo/runtime/go-setenv.c	Fri Apr 27 09:25:43 2012 -0700
@@ -50,7 +50,7 @@
 
 #else /* !defined(HAVE_SETENV) */
 
-  kn = malloc (k.__length + v.__length + 2);
+  kn = __go_alloc (k.__length + v.__length + 2);
   __builtin_memcpy (kn, ks, k.__length);
   kn[k.__length] = '=';
   __builtin_memcpy (kn + k.__length + 1, vs, v.__length);

Reply via email to