From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32431 invoked by alias); 9 Jan 2002 00:55:15 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Received: (qmail 32404 invoked from network); 9 Jan 2002 00:55:15 -0000 Received: from unknown (HELO lacrosse.corp.redhat.com) (12.107.208.154) by sources.redhat.com with SMTP; 9 Jan 2002 00:55:15 -0000 Received: from cgf.cipe.redhat.com (dhcpd72.meridian.redhat.com [172.16.47.72]) by lacrosse.corp.redhat.com (8.11.6/8.9.3) with ESMTP id g090tEw01635 for ; Tue, 8 Jan 2002 19:55:14 -0500 Received: (from cgf@localhost) by cgf.cipe.redhat.com (8.11.6/8.8.7) id g090tNQ29118 for cygwin@cygwin.com; Tue, 8 Jan 2002 19:55:23 -0500 Date: Tue, 08 Jan 2002 16:55:00 -0000 From: Christopher Faylor To: cygwin@cygwin.com Subject: Re: bash/cmd CTRL-C problem... Message-ID: <20020109005523.GA28659@redhat.com> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <037a01c197cf$1d0a4000$0200a8c0@lifelesswks> <20020107234555.GA11984@redhat.com> <03ca01c197d9$8a16c510$0200a8c0@lifelesswks> <20020108002140.GA12820@redhat.com> <03f001c197dd$7a9bec10$0200a8c0@lifelesswks> <013201c19812$2125e750$0200a8c0@lifelesswks> <20020108161950.GC22944@redhat.com> <01a401c19892$2f5fa8d0$0200a8c0@lifelesswks> <20020109003913.GA28328@redhat.com> <042a01c198a6$b03bb2a0$0200a8c0@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 X-SW-Source: 2002-01/txt/msg00452.txt.bz2 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/