about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2001-08-23 00:51:01 +0000
committerRoland McGrath <roland@gnu.org>2001-08-23 00:51:01 +0000
commite225a4442bd3d9324a20491064f5227bc4232d34 (patch)
tree38d6265df27419fe4c07e00865c76c26b0c785a1
parentf95ada8103d2eda8ff201653df134d10ba75fac6 (diff)
downloadglibc-e225a4442bd3d9324a20491064f5227bc4232d34.tar.gz
glibc-e225a4442bd3d9324a20491064f5227bc4232d34.tar.xz
glibc-e225a4442bd3d9324a20491064f5227bc4232d34.zip
2001-08-22 Roland McGrath <roland@frob.com>
	* sysdeps/generic/dl-environ.c: Include <stdlib.h> and <unistd.h>,
	and don't declare unsetenv or _environ directly.
	(unsetenv): Return int, not void.  Use __environ instead of _environ.
-rw-r--r--sysdeps/generic/dl-environ.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sysdeps/generic/dl-environ.c b/sysdeps/generic/dl-environ.c
index 9b317548ec..7a3da0c4b5 100644
--- a/sysdeps/generic/dl-environ.c
+++ b/sysdeps/generic/dl-environ.c
@@ -18,11 +18,10 @@
    02111-1307 USA.  */
 
 #include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
 #include <ldsodefs.h>
 
-extern char **_environ;
-extern void unsetenv (const char *name);
-
 /* Walk through the environment of the process and return all entries
    starting with `LD_'.  */
 char *
@@ -51,13 +50,13 @@ _dl_next_ld_env_entry (char ***position)
   return result;
 }
 
-void
+int
 unsetenv (const char *name)
 {
   const size_t len = strlen (name);
   char **ep;
 
-  ep = _environ;
+  ep = __environ;
   while (*ep != NULL)
     if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
       {
@@ -71,4 +70,6 @@ unsetenv (const char *name)
       }
     else
       ++ep;
+
+  return 0;
 }