This is the mail archive of the cygwin@cygwin.com 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: [list] Terminating spawned cygwin programs from the starting application


> Hi
> 
> I am kinda new in cygwin and i need some help. 
> 
> What i do now.
> I have a win32 application. In that i am launching using 
> CreateProcess, ssh. Also i intercept stdin, stdout and stderr using 
> pipes. 
> 
> What i want to do:
> At a certain point in time i want to terminate the ssh process i 
> launched
> 
> The problem:
> Now i am terminating the process using TerminateProcess. It seems 
> that its not really a good idea. When i try to close the handle of 
> the pipe for stderr with CloseHandle the application freezes, never 
> comes back from that. It looks to me like its a deadlock inside or 
> something. I also have a thread that listens when something is 
> written in stderr and that freezes too in FileRead call. 
> 
> What other possible ways of terminating i have. I was thinking to 
> emulate a CTRL+C but i don't know so much of cygwin internals. 

try using:

BOOL GenerateConsoleCtrlEvent(
  DWORD dwCtrlEvent,
  DWORD dwProcessGroupId
);

Chris


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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]