aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKostik Belousov <kostikbel@ukr.net>2007-12-01 11:52:42 +0000
committerSamuel Tardieu <sam@gcc.gnu.org>2007-12-01 11:52:42 +0000
commit353301145bc799346eb4349c68c3e043b08c28cc (patch)
tree7a99b33d85d7efbb2889fd2d6eaa8531ece9ce96 /gcc
parent867f133ec412ca7592f16b804b34aac9b82703f2 (diff)
downloadgcc-353301145bc799346eb4349c68c3e043b08c28cc.zip
gcc-353301145bc799346eb4349c68c3e043b08c28cc.tar.gz
gcc-353301145bc799346eb4349c68c3e043b08c28cc.tar.bz2
re PR ada/33722 (putenv() is made posix-conformant on FreeBSD 7.x)
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/env.c6
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index aff5640..b9a6caa 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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.
diff --git a/gcc/ada/env.c b/gcc/ada/env.c
index 808f10b..4d36109 100644
--- a/gcc/ada/env.c
+++ b/gcc/ada/env.c
@@ -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);