2001-08-22 Roland McGrath <roland@frob.com>
authorRoland McGrath <roland@gnu.org>
Thu, 23 Aug 2001 00:51:01 +0000 (00:51 +0000)
committerRoland McGrath <roland@gnu.org>
Thu, 23 Aug 2001 00:51:01 +0000 (00:51 +0000)
* 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.

sysdeps/generic/dl-environ.c

index 9b31754..7a3da0c 100644 (file)
    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;
 }