Date: Sat, 3 Aug 2013 20:01:32 +0200 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: Hiroki Sato <hrs@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, oshogbo@FreeBSD.org Subject: Re: svn commit: r252603 - head/usr.sbin/rwhod Message-ID: <20130803180132.GA1403@garage.freebsd.pl> In-Reply-To: <20130804.012445.1330578101731029775.hrs@allbsd.org> References: <201307032104.r63L4KEE015937@svn.freebsd.org> <20130804.012445.1330578101731029775.hrs@allbsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--pWyiEgJYm5f9v55/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Aug 04, 2013 at 01:24:45AM +0900, Hiroki Sato wrote: > Pawel Jakub Dawidek <pjd@FreeBSD.org> wrote > in <201307032104.r63L4KEE015937@svn.freebsd.org>: >=20 > pj> Author: pjd > pj> Date: Wed Jul 3 21:04:20 2013 > pj> New Revision: 252603 > pj> URL: http://svnweb.freebsd.org/changeset/base/252603 > pj> > pj> Log: > pj> The whole sending functionality was implemented within signal handl= er, > pj> which is very bad idea. Split sending and receiving in two processe= s, > pj> which fixes this problem and will help to sandbox rwhod. > pj> > pj> Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org> > pj> Sponsored by: Google Summer of Code 2013 > pj> Reviewed by: pjd > pj> MFC after: 1 month >=20 > (snip) >=20 > pj> if (!quiet_mode) { > pj> - signal(SIGALRM, onalrm); > pj> - onalrm(0); > pj> + pid_child_receiver =3D pdfork(&fdp, 0); > pj> + if (pid_child_receiver =3D=3D 0) { > pj> + receiver_process(); > pj> + } else if (pid_child_receiver > 0) { > pj> + sender_process(); > pj> + } else if (pid_child_receiver =3D=3D -1) { > pj> + syslog(LOG_ERR, "pdfork: %m"); > pj> + exit(1); > pj> + } >=20 > pdfork() is available only when options PROCDESC is defined and > GENERIC does not have it. Ah, indeed. Thanks for letting me know. I think the proper fix here is to just add PROCDESC to GENERIC as it will be used more and more frequently. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --pWyiEgJYm5f9v55/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlH9RXwACgkQForvXbEpPzSqBgCgxwozXerPeP7uH6PKpWIs4TVg u5YAoMNVCOQXHv2rup99pLVJjd38iOOe =4wnv -----END PGP SIGNATURE----- --pWyiEgJYm5f9v55/--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130803180132.GA1403>