summaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authoriains <iains@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-18 10:33:37 +0000
committeriains <iains@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-18 10:33:37 +0000
commitfff1535d51bca70449fbdca481abd42a44974648 (patch)
tree5fc208bc3baf41e825404c97445ff45b58f1f042 /libiberty
parentbc36279171963c2495f0fab3c63a1333c4adc42f (diff)
Fix PR63758 by using the _NSGetEnviron() API on Darwin
include/ Roland McGrath <roland@gnu.org> PR other/63758 * environ.h: New file. libiberty/ Roland McGrath <roland@gnu.org> Iain Sandoe <iain@codesourcery.com> PR other/63758 * pex-unix.c: Obtain the environment interface from settings in environ.h rather than in-line code. Update copyright date. * setenv.c: Likewise. * xmalloc.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228942 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog9
-rw-r--r--libiberty/pex-unix.c5
-rw-r--r--libiberty/setenv.c10
-rw-r--r--libiberty/xmalloc.c5
4 files changed, 17 insertions, 12 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 1cd2aea1f977..3fe0f69fac5d 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,12 @@
+2015-10-18 Roland McGrath <roland@gnu.org>
+ Iain Sandoe <iain@codesourcery.com>
+
+ PR other/63758
+ * pex-unix.c: Obtain the environment interface from settings in
+ environ.h rather than in-line code. Update copyright date.
+ * setenv.c: Likewise.
+ * xmalloc.c: Likewise.
+
2015-09-30 Jason Merrill <jason@redhat.com>
* cp-demangle.c (d_cv_qualifiers): Dx means transaction_safe.
diff --git a/libiberty/pex-unix.c b/libiberty/pex-unix.c
index 071511574782..b48f315f83fa 100644
--- a/libiberty/pex-unix.c
+++ b/libiberty/pex-unix.c
@@ -2,7 +2,7 @@
with other subprocesses), and wait for it. Generic Unix version
(also used for UWIN and VMS).
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2009,
- 2010 Free Software Foundation, Inc.
+ 2010, 2015 Free Software Foundation, Inc.
This file is part of the libiberty library.
Libiberty is free software; you can redistribute it and/or
@@ -23,6 +23,7 @@ Boston, MA 02110-1301, USA. */
#include "config.h"
#include "libiberty.h"
#include "pex-common.h"
+#include "environ.h"
#include <stdio.h>
#include <signal.h>
@@ -390,8 +391,6 @@ pex_child_error (struct pex_obj *obj, const char *executable,
/* Execute a child. */
-extern char **environ;
-
#if defined(HAVE_SPAWNVE) && defined(HAVE_SPAWNVPE)
/* Implementation of pex->exec_child using the Cygwin spawn operation. */
diff --git a/libiberty/setenv.c b/libiberty/setenv.c
index 714ca0a40768..5b51193319de 100644
--- a/libiberty/setenv.c
+++ b/libiberty/setenv.c
@@ -1,5 +1,5 @@
-/* Copyright (C) 1992, 1995, 1996, 1997, 2002, 2011 Free Software Foundation,
- Inc.
+/* Copyright (C) 1992, 1995, 1996, 1997, 2002, 2011, 2015
+ Free Software Foundation, Inc.
This file based on setenv.c in the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -62,11 +62,7 @@ extern int errno;
#endif
#define __environ environ
-#ifndef HAVE_ENVIRON_DECL
-#ifndef environ
-extern char **environ;
-#endif
-#endif
+#include "environ.h"
#undef setenv
#undef unsetenv
diff --git a/libiberty/xmalloc.c b/libiberty/xmalloc.c
index 3e97aab563f0..f849aee53e28 100644
--- a/libiberty/xmalloc.c
+++ b/libiberty/xmalloc.c
@@ -1,5 +1,6 @@
/* memory allocation routines with error checking.
- Copyright 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
+ Copyright 1989, 1990, 1991, 1992, 1993, 1994, 2015
+ Free Software Foundation, Inc.
This file is part of the libiberty library.
Libiberty is free software; you can redistribute it and/or
@@ -65,6 +66,7 @@ function will be called to print an error message and terminate execution.
#endif
#include "ansidecl.h"
#include "libiberty.h"
+#include "environ.h"
#include <stdio.h>
@@ -117,7 +119,6 @@ void
xmalloc_failed (size_t size)
{
#ifdef HAVE_SBRK
- extern char **environ;
size_t allocated;
if (first_break != NULL)