This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

#include <stdio.h>

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>

campbe_r@washington $ ./a.exe 
TERM is: ansi
parent TERM is: ansi
child  TERM is: ansi
campbe_r@washington $ 

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.

Attachment: 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/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]