Re: 1.5.12: TERM environment reset to "cygwin" after fork()

2004-12-03 Thread Christopher Faylor
On Fri, Dec 03, 2004 at 04:44:01PM -0500, Richard Campbell wrote:
>>Provide a simple test case, that is compilable and linkable so that
>>we can investigate your claim.
>
>#include 
>
>int main(int argc, char **argv)
>{
>   setenv("TERM", "ansi", 1);
>/* ... blah, blah, ... */
>printf("TERM is: %s\n", getenv("TERM"));  /* prints "ansi" as expected */
>int i = fork();
>if (i < 0)
>printf("Bad Business...");
>else if ( i > 0 )
>printf("parent TERM is: %s\n", getenv("TERM")); 
>else
>printf("child  TERM is: %s\n", getenv("TERM")); 
>}
>
>C:\dl>a.exe
>TERM is: ansi
>parent TERM is: ansi
>child  TERM is: cygwin

Thanks.  That pinpointed the problem it will be fixed in the next release.

Ordinarily I'd say "try a snapshot" but apparently I've destabilized things
a bit in snapshot land so I wouldn't recommend using a snapshot right now.

cgf

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: 1.5.12: TERM environment reset to "cygwin" after fork()

2004-12-03 Thread Richard Campbell
>Provide a simple test case, that is compilable and linkable so that
>we can investigate your claim.

#include 

int main(int argc, char **argv)
{
   setenv("TERM", "ansi", 1);
/* ... blah, blah, ... */
printf("TERM is: %s\n", getenv("TERM"));  /* prints "ansi" as expected */
int i = fork();
if (i < 0)
printf("Bad Business...");
else if ( i > 0 )
printf("parent TERM is: %s\n", getenv("TERM")); 
else
printf("child  TERM is: %s\n", getenv("TERM")); 
}

C:\dl>a.exe
TERM is: ansi
parent TERM is: ansi
child  TERM is: cygwin

C:\dl>

[EMAIL PROTECTED] $ ./a.exe 
TERM is: ansi
parent TERM is: ansi
child  TERM is: ansi
[EMAIL PROTECTED] $ 

Not sure why it would give different results from cmd.exe and from bash.

cygcheck -s output attached, but it's a windows 2000 machine with sp 4, 
cygwin 1.5.12, gcc 3.3.3.

-Richard Campbell.


cygcheck.out
Description: cygcheck.out
--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/

Re: 1.5.12: TERM environment reset to "cygwin" after fork()

2004-12-03 Thread Christopher Faylor
On Fri, Dec 03, 2004 at 04:21:40PM -0500, B. Scott Smith wrote:
>Hi all,
>
>Version: CYGWIN_NT-5.0 -- 1.5.12(0.116/4/2) -- i686 unknown unknown Cygwin
>
>I set the TERM environment variable in my application by calling 
>setenv(). A subsequent call to getenv("TERM") yields the expected value. 
>However, after performing a fork(), the call to getenv("TERM") returns 
>"cygwin". This is the case for both the parent and the child.
>
>-- I have found a big clue. If I set the TERM variable in the Windows 
>environment prior to running my program (it can be set to anything at 
>all), it works as expected.
>
>Any ideas?

Provide a simple test case, that is compilable and linkable so that
we can investigate your claim.

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: 1.5.12: TERM environment reset to "cygwin" after fork()

2004-12-03 Thread Christopher Faylor
On Fri, Dec 03, 2004 at 02:35:59PM -0500, B. Scott Smith wrote:
>Version: CYGWIN_NT-5.0 -- 1.5.12(0.116/4/2) -- i686 unknown unknown Cygwin
>
>I set the TERM environment variable in my application by calling 
>setenv(). A subsequent call to getenv("TERM") yields the expected value. 
>However, after performing a fork(), the call to getenv("TERM") returns 
>"cygwin". This is the case for both the parent and the child.
>
>Any ideas?

Simple test case?

cgf

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/