octave-maintainers
[Top][All Lists]
Advanced

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

Re: [Win32] putenv modifications not inherited by child processed (Was:


From: Eric Blake
Subject: Re: [Win32] putenv modifications not inherited by child processed (Was: Heap corruption in putenv)
Date: Fri, 15 Feb 2013 15:24:28 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 02/15/2013 08:10 AM, Michael Goffioul wrote:
> The problem is that the "environ" variable is just a mirror of the
> environment that is manipulated through GetEnvironmentVariable and
> SetEnvironmentVariable. Manipulating the "environ" variable directly has no
> effect at the OS level and will only affect the current process (only calls
> to _putenv will actually propagate the changes through Win32 API). Child
> processes will not see the modified environment. Moreover even in the
> current process, I believe the values returned by GetEnvironmentVariable
> and "environ" (or getenv) will not be in sync.

How are you spawning your child processes?  Is it simple enough to wrap
all calls that create child processes so that those call sites iterate
through environ and shove it back into the OS level environment, so that
the child inherits the right thing, while not worrying about the OS
level environment for the rest of the process?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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