problem with getppid()

Eduardo Chappa chappa@math.washington.edu
Thu Sep 15 17:30:00 GMT 2005


*** Corinna Vinschen (pcorinna-cygwin@cygwin.cometh) wrote in the cygwin...:

:) On Sep 15 09:18, Eduardo Chappa wrote:
:) >   The problem I have is that when Pine gets ppid == 1 it exits [...]
:) 
:) That's a bug in pine.  It means, you can't run pine from cmd.exe, resp. 
:) command.com.

Corinna,

  I can run Pine in cmd.exe, I have no problem with that. Let me give you 
and idea of the code.

 res = select()

 if(res == 0){
    if(getppid() == 1)
      "exit(0)";

    continue doing its stuff;
 }

 This code runs perfectly in Linux, both in terminal and under gdb, and it 
runs very well in Cygwin, but as you point out it does not run under 
cmd.exe. It is not a problem that it does not run in the latter case 
because one can run it under cygwin on a bash shell, so the latter is not 
an issue that is specially troubling. The real issue is that I get an 
"exit(0)" under gdb. That's my real issue. That's what I'd like to solve.

  From what I read in an earlier message from you, it seems like there is 
a way to fix the problem I have, and if it is possible to fix it, I would 
be grateful if it was fixed. I suppose that even though you explained 
where the problem is, that you can appreciate that getppid is not behaving 
correctly in the situation I described before.

  Of course it may be important for someone to be able to run Pine in 
cmd.exe, but a good workaround to that exists. I do not have a good 
workaround, hence my request. I hope you appreciate my point and what I am 
requesting.

  Thank you,

-- 
Eduardo
http://www.math.washington.edu/~chappa/pine/

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



More information about the Cygwin mailing list