From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5750 invoked by alias); 18 Jul 2008 17:13:24 -0000 Received: (qmail 5741 invoked by uid 22791); 18 Jul 2008 17:13:24 -0000 X-Spam-Check-By: sourceware.org Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Fri, 18 Jul 2008 17:12:54 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 369F26D42F1; Fri, 18 Jul 2008 19:14:49 +0200 (CEST) Date: Fri, 18 Jul 2008 17:13:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Control-c of a bat file does not kill commands run by bat file in some cases Message-ID: <20080718171449.GI5675@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <99652.77639.qm@web51005.mail.re2.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <99652.77639.qm@web51005.mail.re2.yahoo.com> User-Agent: Mutt/1.5.16 (2007-06-09) Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2008-07/txt/msg00397.txt.bz2 On Jul 18 09:45, Mark Charney wrote: > Is this a bug or a feature? > > When I run a program loop.exe whose entire source is "int main() { while(1); return 0;}", compiled with MS VS8 or cygwin's gcc, from a bat file whose contents are just "loop.exe" and hit control-c while it is running, sometimes cygwin kills the loop.exe and sometimes it does not. Here are the 6 scenarios that I tried: > > 1. OKAY tcsh from a cmd.exe > 2. OKAY bash from a cmd.exe > 3. BROKEN tcsh from an rxvt X window on local machine > 4. BROKEN bash from an rxvt X window on local machine > 5. BROKEN tcsh via ssh from a remote machine (public key auth) > 6. BROKEN bash via ssh from a remote machine (public key auth) > > OKAY means it kills the bat file and loop.exe > BROKEN means loop.exe continues to run after control-c. > > bash/tcsh doesn't not seem to matter, I just did it because I first noticed the problem on tcsh. > > At the very least, if it is a feature, it is inconsistent. What do you expect? In cases 3 to 6 you're running a VC++ console application in a Cygwin pseudo tty session, not in a Windows console. Native Windows apps have no idea what a Cygwin signal (in this case SIGINT) is, so it doesn't handle it. And, since you don't have a Windows console, you don't get Windows console "signal" handling which would inject a thread into the application which by default stops the application on Ctrl-C. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/