[Libguestfs] Gnulib setenv on Mac OS X bug?

Bruno Haible bruno at clisp.org
Sun Mar 21 22:18:16 UTC 2010


Hi,

Richard W.M. Jones wrote:
> There seems to be a bug in Gnulib's setenv module on Mac OS X.  At
> configure time it says:
> 
> checking whether setenv validates arguments ... no
> 
> (The test program it is running is:
> 
> | int
> | main ()
> | {
> | 
> |        if (setenv ("", "", 0) != -1) return 1;
> |        if (errno != EINVAL) return 2;
> |        if (setenv ("a", "=", 1) != 0) return 3;
> |        if (strcmp (getenv ("a"), "=") != 0) return 4;
> | 
> |   ;
> |   return 0;
> | }
> 
> and this returns status code 4)

This is normal. It's a small bug in the system's setenv routine.

> As a result, in stdlib.h, this:
> 
> #if @GNULIB_SETENV@
> # if @REPLACE_SETENV@
> #  undef setenv
> #  define setenv rpl_setenv
> 
> is replaced by:
> 
> #if 1
> # if 1
> #  undef setenv
> #  define setenv rpl_setenv

This is expected too.

> However, no rpl_setenv function is getting generated in libgnu.a

If you do
  $ grep LIBOBJ config.status
you should see something like this:
  S["gl_LTLIBOBJS"]=" setenv.lo"
  S["gl_LIBOBJS"]=" setenv.o"

If you do
  $ grep -i _setenv config.status
you should see something like this (among others):
  S["REPLACE_SETENV"]="1"
  S["HAVE_SETENV"]="1"
  S["GNULIB_SETENV"]="1"

If not, then please show the details.

Bruno




More information about the Libguestfs mailing list