From owner-svn-src-head@FreeBSD.ORG Sat Aug 3 18:00:43 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C4F402EF; Sat, 3 Aug 2013 18:00:43 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 8858028F4; Sat, 3 Aug 2013 18:00:42 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 87DAED0D; Sat, 3 Aug 2013 19:55:37 +0200 (CEST) Date: Sat, 3 Aug 2013 20:01:32 +0200 From: Pawel Jakub Dawidek To: Hiroki Sato Subject: Re: svn commit: r252603 - head/usr.sbin/rwhod Message-ID: <20130803180132.GA1403@garage.freebsd.pl> References: <201307032104.r63L4KEE015937@svn.freebsd.org> <20130804.012445.1330578101731029775.hrs@allbsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pWyiEgJYm5f9v55/" Content-Disposition: inline In-Reply-To: <20130804.012445.1330578101731029775.hrs@allbsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, oshogbo@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Aug 2013 18:00:43 -0000 --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 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 > 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/--