Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com> List-Archive: <http://sourceware.org/ml/cygwin/> List-Post: <mailto:cygwin AT cygwin DOT com> List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Wed, 2 Mar 2005 20:03:33 -0500 From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com> To: cygwin AT cygwin DOT com Subject: Re: 1.5.12: signals stop working after system() Message-ID: <20050303010333.GA27514@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com References: <bccc8ac805030123443f06f102 AT mail DOT gmail DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <bccc8ac805030123443f06f102@mail.gmail.com> User-Agent: Mutt/1.4.1i On Wed, Mar 02, 2005 at 02:44:34AM -0500, Jeff Allen wrote: >Ctrl-C cannot kill my program after it calls system(). It's happening >in a bigger program that uses UDP, etc. But I can reproduce it in the >tiny program below. > >The following test program shows the problem. You can kill it with >ctrl-c during the first sleep, but you cannot kill it during the >second sleep. It will exit correctly after 5 seconds. > >#include <stdio.h> >int main() >{ > printf("sleeping for 5 secs...\n"); > sleep(5); > system("echo the hostname is: `hostname`"); > printf("sleeping for 5 secs...\n"); > sleep(5); >} > >I noticed lots of discussion about signals in the archives, but >nothing related to signals and system(). There actually was some discussion about signals and system because I fixed a problem with them back in (I think) 2003. I didn't go far enough in my fix, however. A better solution should be in today's snapshot: http://cygwin.com/snapshots/ which is uploading right now. cgf -- 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/