Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT cygwin DOT com Delivered-To: mailing list cygwin-developers AT cygwin DOT com Message-ID: <3E78735B.3040408@hekimian.com> Date: Wed, 19 Mar 2003 08:40:43 -0500 X-Sybari-Trust: 2bad4d03 36b09be0 04609a3e 00000109 From: Joe Buehler Reply-To: jbuehler AT hekimian DOT com Organization: Spirent Communications, Inc. User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Cygwin Developers Subject: proposed change to spawnve() signal behavior X-Enigmail-Version: 0.73.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Is the below patch acceptable? If I understand the code correctly, it should copy SIG_IGN to spawned children. This is a fix for a ksh93 problem -- compiling it to use spawnve() instead of fork() causes shell script malfunctions because children do not inherit the parent's signal handler settings. The ksh93 code assumes that spawnve() inherits signal handler settings. As far as I can tell, there is no real spec for spawnve(), it is non-standard across platforms, so I don't think this breaks any standards... -- Joe Buehler --- winsup/cygwin/exceptions.cc 2003-02-11 10:11:14.000000000 -0500 +++ winsup/cygwin/exceptions.cc 2003-03-19 08:34:42.000000000 -0500 @@ -738,15 +738,15 @@ void __stdcall signal_fixup_after_exec (bool isspawn) { /* Set up child's signal handlers */ for (int i = 0; i < NSIG; i++) { myself->getsig (i).sa_mask = 0; - if (myself->getsig (i).sa_handler != SIG_IGN || isspawn) + if (myself->getsig (i).sa_handler != SIG_IGN) myself->getsig (i).sa_handler = SIG_DFL; } } static int interrupt_on_return (sigthread *, int, void *, struct sigaction&) __attribute__((regparm(3))); static int interrupt_on_return (sigthread *th, int sig, void *handler, struct sigaction& siga)