Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Sat, 28 Apr 2001 17:29:50 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: cygwin apps in pipe ignore ctrl+c FIX Message-ID: <20010428172950.A7807@redhat.com> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <000d01c0d022$c577c480$248a42d8 AT hpcustomer> <20010428170501 DOT C7632 AT redhat DOT com> <20010428170633 DOT D7632 AT redhat DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.11i In-Reply-To: <20010428170633.D7632@redhat.com>; from cgf@redhat.com on Sat, Apr 28, 2001 at 05:06:33PM -0400 On Sat, Apr 28, 2001 at 05:06:33PM -0400, Christopher Faylor wrote: >On Sat, Apr 28, 2001 at 05:05:01PM -0400, Christopher Faylor wrote: >>On Sat, Apr 28, 2001 at 01:32:54PM -0700, Tim Baker wrote: >>>In a previous message I reported that Cygwin apps running >>>in a pipe would ignore Ctrl+C from the command-line. So >>>I got the sources and built cygwin1.dll, and found the problem >>>in winsup/cygwin/exceptions.cc. >>> >>>This is the original code (relevant parts only): >>> >>>static BOOL WINAPI >>>ctrl_c_handler (DWORD type) >>>{ >>> tty_min *t = cygwin_shared->tty.get_tty (myself->ctty); >>> if (t->getpgid () != myself->pid || >>> (GetTickCount () - t->last_ctrl_c) < MIN_CTRL_C_SLOP) >>> return TRUE; >>> else >>> { >>> t->last_ctrl_c = GetTickCount (); >>> kill (-myself->pid, SIGINT); >>> t->last_ctrl_c = GetTickCount (); >>> return TRUE; >>> } >>>} >>> >>>The problem was that t->getpgid() returns *zero*. So I added a >>>check for zero as follows: >> >>Thank you for looking into this, but just as a hint, when debugging >>this type of thing, it is usually better to figure out if the code >>to not account for whether the value was zero or if it is, in fact, > ^ > is meant to >>a bug that the value can be zero. >> >>I don't know if pgid is supposed to be nonzero in this case, but >>I suspect that it is. Must be my day for being unclear. #1 Thank you immensely for tracking this problem down. #2 I will investigate the non-zero problem above. I'll get some kind of fix into Cygwin 1.3.2. cgf -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple