This is the mail archive of the
mailing list for the Cygwin project.
Re: bash/cmd CTRL-C problem...
On Wed, Jan 09, 2002 at 11:43:41AM +1100, Robert Collins wrote:
>>I have to think about the race issues here. It seems like you can't
>>get away without some kind of additional communication between the
>>parent and the child.
>True. The problem is that we can't communicate with non-cygwin
I think basically you just have to ensure that the stub doesn't exit
on CTRL-C. I can't think of a scenario where that's desireable now.
I think you could get just about the same behavior that you're describing
if you just blocked SIGINT prior to calling CreateProcess.
However, you've uncovered another problem in that it is possible for
both the stub and the child to fire off a kill() resulting in double
sending of CTRL-C during an exec().
So, I think the easiest fix for the current problem is just to do a
'signal (SIGINT, SIG_IGN)' prior to calling CreateProcess, restoring
the previous signal handler if the CreateProcess fails.
That doesn't solve the double sending of CTRL-Cs but that's a separate
problem, I think.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html