From owner-svn-src-all@FreeBSD.ORG Wed Jan 12 16:17:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ECD71065674; Wed, 12 Jan 2011 16:17:14 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 041418FC15; Wed, 12 Jan 2011 16:17:13 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 128E34569A; Wed, 12 Jan 2011 17:17:12 +0100 (CET) Received: from localhost (pdawidek.whl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id E8EAA45683; Wed, 12 Jan 2011 17:17:06 +0100 (CET) Date: Wed, 12 Jan 2011 17:16:59 +0100 From: Pawel Jakub Dawidek To: Kostik Belousov Message-ID: <20110112161659.GD1792@garage.freebsd.pl> References: <201101121438.p0CEcHWW092155@svn.freebsd.org> <20110112161019.GW2518@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kORqDWCi7qDJ0mEj" Content-Disposition: inline In-Reply-To: <20110112161019.GW2518@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217308 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jan 2011 16:17:14 -0000 --kORqDWCi7qDJ0mEj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 12, 2011 at 06:10:19PM +0200, Kostik Belousov wrote: > On Wed, Jan 12, 2011 at 02:38:17PM +0000, Pawel Jakub Dawidek wrote: > > Author: pjd > > Date: Wed Jan 12 14:38:17 2011 > > New Revision: 217308 > > URL: http://svn.freebsd.org/changeset/base/217308 > >=20 > > Log: > > Add a note that when custom signal handler is installed for a signal, > > signal action is restored to default in child after fork(2). > > In this case there is no need to do anything with dummy SIGCHLD handl= er, > > because after fork(2) it will be automatically reverted to SIG_IGN. > > =20 > > Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com > > MFC after: 3 days > >=20 > > Modified: > > head/sbin/hastd/hooks.c > >=20 > > Modified: head/sbin/hastd/hooks.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sbin/hastd/hooks.c Wed Jan 12 14:35:29 2011 (r217307) > > +++ head/sbin/hastd/hooks.c Wed Jan 12 14:38:17 2011 (r217308) > > @@ -372,6 +372,11 @@ hook_execv(const char *path, va_list ap) > > descriptors(); > > PJDLOG_VERIFY(sigemptyset(&mask) =3D=3D 0); > > PJDLOG_VERIFY(sigprocmask(SIG_SETMASK, &mask, NULL) =3D=3D 0); > > + /* > > + * Dummy handler set for SIGCHLD in the parent should be > > + * changed after fork(2) automatically to the default SIG_IGN, > > + * so there is no need to do anything with it. > > + */ > > execv(path, args); > > pjdlog_errno(LOG_ERR, "Unable to execute %s", path); > > exit(EX_SOFTWARE); > Fork does not change the disposition of the signals. > Exec family of the functions indeed reset the signals with handler > to default disposition. You are right, thanks. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --kORqDWCi7qDJ0mEj Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk0t0/sACgkQForvXbEpPzSyIwCgk2u0EggRXYxAC5RGt4Eq/PWp 1rIAoLlYdQ8U+J9MFDstaZUkGBOGffdL =H6bO -----END PGP SIGNATURE----- --kORqDWCi7qDJ0mEj--