cvs commit: src/lib/libc/stdlib getenv.3 getenv.c putenv.c setenv.c

Henrik Brix Andersen henrik at brixandersen.dk
Mon Apr 30 18:36:27 UTC 2007


Hi,

On Mon, Apr 30, 2007 at 04:56:18PM +0000, Andrey A. Chernov wrote:
> ache        2007-04-30 16:56:18 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     lib/libc/stdlib      getenv.3 getenv.c putenv.c setenv.c 
>   Log:
>   Make putenv() fully conforms to Open Group specs Issue 6
>   (also IEEE Std 1003.1-2001)
>   
>   The specs explicitly says that altering passed string
>   should change the environment, i.e. putenv() directly puts its arg
>   into environment (unlike setenv() which just copies it there).
>   It means that putenv() can't be implemented via setenv()
>   (like we have before) at all. Putenv() value lives (allows modifying)
>   up to the next putenv() or setenv() call.

Todays changes to *env() appears to have broken stuff (my -CURRENT box
fails to build many ports after these changes, due to missing
environment variables in the build environment).

Here is a simple test-case:

$ env -vi foo=bar env
#env clearing environ
#env setenv:    foo=bar
#env executing: env
#env    arg[0]= 'env'

Notice that the second instance of env(1) doesn't see the $foo
environment variable.

This is the output of the same test on my RELENG_6 box:

$ env -vi foo=bar env
#env clearing environ
#env setenv:    foo=bar
#env executing: env
#env    arg[0]= 'env'
foo=bar

Regards,
Brix
-- 
Henrik Brix Andersen <henrik at brixandersen.dk>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 209 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20070430/e59de9a4/attachment.pgp


More information about the cvs-src mailing list