Date: Wed, 12 Jan 2011 17:16:59 +0100 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: Kostik Belousov <kostikbel@gmail.com> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217308 - head/sbin/hastd Message-ID: <20110112161659.GD1792@garage.freebsd.pl> In-Reply-To: <20110112161019.GW2518@deviant.kiev.zoral.com.ua> References: <201101121438.p0CEcHWW092155@svn.freebsd.org> <20110112161019.GW2518@deviant.kiev.zoral.com.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110112161659.GD1792>