# HG changeset patch # User Bruno Haible # Date 1276080040 -7200 # Node ID 6999c44d1f591eb06a2194eadcf415e35ce1905f # Parent 50e9a2259a7dbd442a252d5b98fce382851aebd4 Module setenv does not depend on 'malloc-posix', 'realloc-posix'. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-06-09 Bruno Haible + + 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 maint.mk: make the news-check rule more configurable diff --git a/lib/setenv.c b/lib/setenv.c --- a/lib/setenv.c +++ b/lib/setenv.c @@ -147,6 +147,9 @@ : 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; }