bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [1/4] setenv, relocwrapper interaction with replacement functions


From: Bruno Haible
Subject: Re: [1/4] setenv, relocwrapper interaction with replacement functions
Date: Wed, 9 Jun 2010 12:40:49 +0200
User-agent: KMail/1.9.9

The setenv module does not depend on 'malloc-posix' and 'realloc-posix',
therefore for the sake of mingw this patch is needed.


2010-06-09  Bruno Haible  <address@hidden>

        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.

--- lib/setenv.c.orig   Wed Jun  9 12:16:39 2010
+++ lib/setenv.c        Wed Jun  9 12:11:26 2010
@@ -147,6 +151,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;
         }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]