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.
This commit is contained in:
Roland McGrath 2001-08-23 00:51:01 +00:00
parent f95ada8103
commit e225a4442b
1 changed files with 6 additions and 5 deletions

View File

@ -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;
}