]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR ada/33722 (putenv() is made posix-conformant on FreeBSD 7.x)
authorKostik Belousov <kostikbel@ukr.net>
Sat, 1 Dec 2007 11:52:42 +0000 (11:52 +0000)
committerSamuel Tardieu <sam@gcc.gnu.org>
Sat, 1 Dec 2007 11:52:42 +0000 (11:52 +0000)
2007-12-01  Kostik Belousov  <kostikbel@ukr.net>

    gcc/ada/
PR ada/33722
* env.c (__gnat_setenv): FreeBSD 7 has a POSIX conformant putenv()
and its argument must not be free()ed.

From-SVN: r130555

gcc/ada/ChangeLog
gcc/ada/env.c

index aff56402a55a97c9e96ea83b99cb16983a2259d9..b9a6caaafb941dc2816b7bd6b06fdceda780423e 100644 (file)
@@ -1,3 +1,9 @@
+2007-12-01  Kostik Belousov  <kostikbel@ukr.net>
+
+       PR ada/33722
+       * env.c (__gnat_setenv): FreeBSD 7 has a POSIX conformant putenv()
+       and its argument must not be free()ed.
+
 2007-11-29  Eric Botcazou  <ebotcazou@adacore.com>
 
        * decl.c (make_packable_type): Retrieve the real name of the type.
index 808f10ba2822a431327cd3ed8699a6a0c8520aff..4d361096872f51a676c9599de2a510d98dbb4925 100644 (file)
@@ -177,9 +177,9 @@ __gnat_setenv (char *name, char *value)
 
   sprintf (expression, "%s=%s", name, value);
   putenv (expression);
-#if defined (__FreeBSD__) || defined (__APPLE__) || defined (__MINGW32__) \
-   ||(defined (__vxworks) && ! defined (__RTP__))
-  /* On some systems like FreeBSD, MacOS X and Windows, putenv is making
+#if (defined (__FreeBSD__) && (__FreeBSD__ < 7)) || defined (__APPLE__) \
+   || defined (__MINGW32__) ||(defined (__vxworks) && ! defined (__RTP__))
+  /* On some systems like pre-7 FreeBSD, MacOS X and Windows, putenv is making
      a copy of the expression string so we can free it after the call to
      putenv */
   free (expression);