Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Tue, 8 Jan 2002 19:55:23 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: bash/cmd CTRL-C problem... Message-ID: <20020109005523.GA28659@redhat.com> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <037a01c197cf$1d0a4000$0200a8c0 AT lifelesswks> <20020107234555 DOT GA11984 AT redhat DOT com> <03ca01c197d9$8a16c510$0200a8c0 AT lifelesswks> <20020108002140 DOT GA12820 AT redhat DOT com> <03f001c197dd$7a9bec10$0200a8c0 AT lifelesswks> <013201c19812$2125e750$0200a8c0 AT lifelesswks> <20020108161950 DOT GC22944 AT redhat DOT com> <01a401c19892$2f5fa8d0$0200a8c0 AT lifelesswks> <20020109003913 DOT GA28328 AT redhat DOT com> <042a01c198a6$b03bb2a0$0200a8c0 AT lifelesswks> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <042a01c198a6$b03bb2a0$0200a8c0@lifelesswks> User-Agent: Mutt/1.3.23.1i 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 >children. 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. cgf -- 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/