From owner-svn-src-all@FreeBSD.ORG Wed Jan 12 16:10:24 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 81878106566B; Wed, 12 Jan 2011 16:10:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 172898FC1E; Wed, 12 Jan 2011 16:10:23 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p0CGAJIS033277 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 12 Jan 2011 18:10:19 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p0CGAJRZ036127; Wed, 12 Jan 2011 18:10:19 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p0CGAJm8036126; Wed, 12 Jan 2011 18:10:19 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 12 Jan 2011 18:10:19 +0200 From: Kostik Belousov To: Pawel Jakub Dawidek Message-ID: <20110112161019.GW2518@deviant.kiev.zoral.com.ua> References: <201101121438.p0CEcHWW092155@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1Wg5Vd7si6EhrIHA" Content-Disposition: inline In-Reply-To: <201101121438.p0CEcHWW092155@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua 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:10:24 -0000 --1Wg5Vd7si6EhrIHA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 handler, > 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. --1Wg5Vd7si6EhrIHA Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk0t0msACgkQC3+MBN1Mb4gFYwCgyqixKqUnmP4KtbIpwoZde1XH eCgAnRON+ggx3ADWSIDlI9PSwDlKyvFH =S6XP -----END PGP SIGNATURE----- --1Wg5Vd7si6EhrIHA--