projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update from texinfo
[gnulib.git]
/
lib
/
setenv.c
diff --git
a/lib/setenv.c
b/lib/setenv.c
index
ee9da0d
..
ba760d6
100644
(file)
--- a/
lib/setenv.c
+++ b/
lib/setenv.c
@@
-64,6
+64,10
@@
__libc_lock_define_initialized (static, envlock)
# define clearenv __clearenv
# define tfind __tfind
# define tsearch __tsearch
# define clearenv __clearenv
# define tfind __tfind
# define tsearch __tsearch
+#else
+/* Use the system functions, not the gnulib overrides in this file. */
+# undef malloc
+# undef realloc
#endif
/* In the GNU C library implementation we try to be more clever and
#endif
/* In the GNU C library implementation we try to be more clever and
@@
-147,6
+151,9
@@
__add_to_environ (const char *name, const char *value, const char *combined,
: realloc (last_environ, (size + 2) * sizeof (char *)));
if (new_environ == NULL)
{
: realloc (last_environ, (size + 2) * sizeof (char *)));
if (new_environ == NULL)
{
+ /* It's easier to set errno to ENOMEM than to rely on the
+ 'malloc-posix' and 'realloc-posix' gnulib modules. */
+ __set_errno (ENOMEM);
UNLOCK;
return -1;
}
UNLOCK;
return -1;
}