X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fputenv.c;h=0602e44e327374759a85839b87fea6304d8f5e04;hb=c3a06f7b517d17794efd655e7e38e84ebdc5c3ea;hp=6acefaaefb86ea0d4f6d4df19e9984dd962f8e9c;hpb=222b0486b7db1b09293e05512873d633440efcb3;p=gnulib.git diff --git a/lib/putenv.c b/lib/putenv.c index 6acefaaef..0602e44e3 100644 --- a/lib/putenv.c +++ b/lib/putenv.c @@ -1,4 +1,5 @@ -/* Copyright (C) 1991, 1994, 1997, 1998, 2000, 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1994, 1997, 1998, 2000, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. @@ -17,9 +18,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include + +/* undef putenv here, because some (e.g., Solaris 10) declare putenv in + with a non-const argument. That would conflict with the declaration of + rpl_putenv below (due to the #define putenv rpl_putenv from config.h). */ +#undef putenv +int rpl_putenv (char const *); #include @@ -30,18 +35,9 @@ # define __set_errno(ev) ((errno) = (ev)) #endif -/* Don't include stdlib.h because some (e.g., Solaris 7) declare putenv - with a non-const argument. That would conflict with the declaration of - rpl_putenv below (due to the #define putenv rpl_putenv from config.h). */ - -void *malloc (); -void free (); - +#include #include - -#if defined (__GNU_LIBRARY__) || defined (HAVE_UNISTD_H) -# include -#endif +#include #if HAVE_GNU_LD # define environ __environ @@ -61,7 +57,7 @@ __libc_lock_define_initialized (static, envlock) #endif static int -unsetenv (const char *name) +_unsetenv (const char *name) { size_t len; char **ep; @@ -109,7 +105,7 @@ rpl_putenv (const char *string) if (name_end == NULL) { /* Remove the variable from the environment. */ - return unsetenv (string); + return _unsetenv (string); } size = 0;