delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2003/03/19/08:40:46

Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT cygwin DOT com>
List-Help: <mailto:cygwin-developers-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
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 <jbuehler AT hekimian DOT com>
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 <cygwin-developers AT cygwin DOT com>
Subject: proposed change to spawnve() signal behavior
X-Enigmail-Version: 0.73.1.0
X-Enigmail-Supports: pgp-inline, pgp-mime

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)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019