projects
/
gnulib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
296be6b
)
Module setenv does not depend on 'malloc-posix', 'realloc-posix'.
author
Bruno Haible
<bruno@clisp.org>
Wed, 9 Jun 2010 10:40:40 +0000
(12:40 +0200)
committer
Bruno Haible
<bruno@clisp.org>
Wed, 9 Jun 2010 10:40:40 +0000
(12:40 +0200)
ChangeLog
patch
|
blob
|
history
lib/setenv.c
patch
|
blob
|
history
diff --git
a/ChangeLog
b/ChangeLog
index
edb9122
..
361016a
100644
(file)
--- a/
ChangeLog
+++ b/
ChangeLog
@@
-1,3
+1,9
@@
+2010-06-09 Bruno Haible <bruno@clisp.org>
+
+ Module setenv does not depend on 'malloc-posix', 'realloc-posix'.
+ * lib/setenv.c (__add_to_environ): Set errno to ENOMEM when malloc or
+ realloc failed.
+
2010-06-08 Peter Simons <simons@cryp.to>
maint.mk: make the news-check rule more configurable
2010-06-08 Peter Simons <simons@cryp.to>
maint.mk: make the news-check rule more configurable
diff --git
a/lib/setenv.c
b/lib/setenv.c
index
ee9da0d
..
178191c
100644
(file)
--- a/
lib/setenv.c
+++ b/
lib/setenv.c
@@
-147,6
+147,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;
}