delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/06/15/03:48:23

From: sos AT prospect DOT com DOT ru (Sergey Okhapkin)
Subject: RE: [BUG] environment not inherited by fork
15 Jun 1997 03:48:23 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <01BC796D.B4DE1260.cygnus.gnu-win32@sos>
Original-To: "gnu-win32 AT cygnus DOT com" <gnu-win32 AT cygnus DOT com>,
"'cgf AT bbc DOT com'"
<cgf AT bbc DOT com>
Encoding: 31 TEXT
Original-Sender: owner-gnu-win32 AT cygnus DOT com

Chris Faylor wrote:
> The following code illustrates a problem with cygwin.dll b18 (the Cygnus
> release version).
> 
> #include <stdio.h>
> main(int argc, char **argv)
> {
> putenv("FOO=BAR");
> printf("parent FOO=%s\n", getenv("FOO"));
> if (fork() > 0) {
>     wait(0);
>     exit(0);
> }
> printf("child FOO=%s\n", getenv("FOO"));
> exit(0);
> }
> 
> It erroneously produces the following output:
> 
> parent FOO=BAR
> child FOO=(null)
> 

It is not neccessary to write such special test program. Just run

"env zzz=asd env" - you'll not see zzz var in env's output.

-- 
Sergey Okhapkin, http://www.lexa.ru/sos
Moscow, Russia
Looking for a job

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019