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]

Re: cygwin apps in pipe ignore ctrl+c


> TB> I have a console app MyApp which runs in a pipe. MyApp calls
> TB> CreateProcess() to launch OtherApp and later calls
> TB> GenerateConsoleCtrlEvent() to send Ctrl+C to OtherApp. When
> TB> OtherApp is non-Cygwin it is interrupted cleanly just as though
> TB> the user had typed Ctrl+C from in the DOS window. But when
> TB> OtherApp is a Cygwin application it ignores any number of
> TB> CTRL_C_EVENTs I send and continues running. So a Cygwin
> TB> app must be calling SetConsoleCtrlHandler() to intercept the
> TB> CTRL_C_EVENT but for some reason it is not behaving properly
> TB> when the Cygwin app is *running in a pipe*. (The Cygwin app IS
> TB> attached to a Win32 console window which is required for
> TB> GenterateConsoleCtrlEvent() to work.)
> 
> use kill() function to interrupt cygwin application. this is a normal
> unix way to do such things.


Sure, but I do not know if OtherApp is going to be a Cygwin app or not.
Sometimes it is not, so calling Cygwin's kill() might not be appropriate.
In any event, this bug effects typing Ctrl+C in a console window too.
When I run "gcc -pipe file.c" and CPP is running, I type Ctrl+C and
CPP does not die. I then type Ctrl+Alt+Del to see the running tasks
and GCC is gone but not CPP (CPP continues running then exits).

-- Tim Baker


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


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