From owner-svn-src-stable@FreeBSD.ORG Thu Jul 29 23:46:25 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D33F1065670; Thu, 29 Jul 2010 23:46:25 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1278E8FC1C; Thu, 29 Jul 2010 23:46:24 +0000 (UTC) Received: by iwn35 with SMTP id 35so947604iwn.13 for ; Thu, 29 Jul 2010 16:46:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:openpgp:content-type:content-transfer-encoding; bh=eIN1aXGj21UKkTnXP5IW5NzpCsJQLQPDpmSXvPSIL/c=; b=SgxUqsSWP8O1sZG6dKeDqIHGLGlN0X9123UZKCEi6pBvZmukGRMVQtAnqV0gDQe+Vk dOxNYILIjgEHBOgnR81ox7EyqX/HAGLqNezp8kfFRRlzpgm/YipujbF84epB9FVTqUXH 6S7b4wIFgzyZNmd5dK+rjwo3HR4HqRrBZAD38= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:openpgp:content-type :content-transfer-encoding; b=S7WtmpH6f7KcFNnqwq/b7hVkVQ9whQ/7NWKLMwT30mD9o/3zEvHCq69yr6J3Kp1e9s u1YRYJwUH2OA96F/r+thHC0DD8YsSdH2rH/5GTeQQ76Po7wkEnA0CV4J3fYd+nFeCpkL HMxwYIt1JRM4mcAdxkn35Cymigaeb44qjHv9c= Received: by 10.231.14.76 with SMTP id f12mr646119iba.63.1280447184370; Thu, 29 Jul 2010 16:46:24 -0700 (PDT) Received: from centel.dataix.local (adsl-99-19-46-227.dsl.klmzmi.sbcglobal.net [99.19.46.227]) by mx.google.com with ESMTPS id e8sm1264750ibb.20.2010.07.29.16.46.22 (version=SSLv3 cipher=RC4-MD5); Thu, 29 Jul 2010 16:46:23 -0700 (PDT) Sender: "J. Hellenthal" Message-ID: <4C5212CC.2070201@dataix.net> Date: Thu, 29 Jul 2010 19:46:20 -0400 From: jhell User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.11) Gecko/20100722 Thunderbird MIME-Version: 1.0 To: Jilles Tjoelker References: <201007291655.o6TGtR0k099119@svn.freebsd.org> In-Reply-To: <201007291655.o6TGtR0k099119@svn.freebsd.org> X-Enigmail-Version: 1.0.1 OpenPGP: id=89D8547E Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, FreeBSD SVN Source All , src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r210616 - stable/8/bin/sh X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2010 23:46:25 -0000 So what has been commited here is implicitly stating that instead of using ( trap 'exit 1' 2 ) in a script to catch SIGINT and exit it is now being done on behalf of the user with no way for them to control it ? Basically this has the same effect on a script that uses ( && ) and to which now have the same meaning. This script should print "PRINTME" twice when ^C during the sleep. #!/bin/sh sleep 5000; echo "PRINTME" echo "PRINTME" Whereas this script with the old behavior would have done what is trying to be done now for the first line but should still print only the second "PRINTME" during a ^C of sleep. #!/bin/sh sleep 5000 && echo "PRINTME" echo "PRINTME" And this script should not print anything when ^C is used during sleep. #!/bin/sh trap 'exit 1' 2 sleep 5000 ; echo "PRINTME" echo "PRINTME" What is being done currently on stable/8 is incorrect... On 07/29/2010 12:55, Jilles Tjoelker wrote: > Author: jilles > Date: Thu Jul 29 16:55:27 2010 > New Revision: 210616 > URL: http://svn.freebsd.org/changeset/base/210616 > > Log: > MFC r208881: sh: Pass through SIGINT if interactive and job control > is enabled. > > This already worked if without job control. > > In either case, this depends on it that a process that terminates due to > SIGINT exits on it (so not with status 1, or worse, 0). > > Example: > sleep 5; echo continued > This does not print "continued" any more if sleep is aborted via ctrl+c. > > Modified: > stable/8/bin/sh/jobs.c > Directory Properties: > stable/8/bin/sh/ (props changed) > > Modified: stable/8/bin/sh/jobs.c > ============================================================================== > --- stable/8/bin/sh/jobs.c Thu Jul 29 16:49:20 2010 (r210615) > +++ stable/8/bin/sh/jobs.c Thu Jul 29 16:55:27 2010 (r210616) > @@ -862,6 +862,7 @@ waitforjob(struct job *jp, int *origstat > { > #if JOBS > pid_t mypgrp = getpgrp(); > + int propagate_int = jp->jobctl && jp->foreground; > #endif > int status; > int st; > @@ -899,6 +900,11 @@ waitforjob(struct job *jp, int *origstat > else > CLEAR_PENDING_INT; > } > +#if JOBS > + else if (rootshell && iflag && propagate_int && > + WIFSIGNALED(status) && WTERMSIG(status) == SIGINT) > + kill(getpid(), SIGINT); > +#endif > INTON; > return st; > } -- jhell,v