Date: Mon, 29 Oct 2012 06:32:42 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Eitan Adler <eadler@freebsd.org> Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r242283 - stable/9/sys/kern Message-ID: <20121029043242.GH73505@kib.kiev.ua> In-Reply-To: <201210290352.q9T3qJa3070064@svn.freebsd.org> References: <201210290352.q9T3qJa3070064@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--Fnm8lRGFTVS/3GuM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 29, 2012 at 03:52:19AM +0000, Eitan Adler wrote: > Author: eadler > Date: Mon Oct 29 03:52:18 2012 > New Revision: 242283 > URL: http://svn.freebsd.org/changeset/base/242283 >=20 > Log: > MFC r241855,r241859: > Update the kill(2) and killpg(2) man pages to the modern permission > checks. Also indicate killpg(2) is POSIX compliant. > =20 > Correct the killpg(2) return values: > =20 > Return EPERM if processes were found but they > were unable to be signaled. > =20 > Return the first error from p_cansignal if no signal was successful. > =20 > Discussed with: jilles > Approved by: cperciva (implicit) >=20 > Modified: > stable/9/sys/kern/kern_sig.c > Directory Properties: > stable/9/sys/ (props changed) According to svn mail, r241855 was not merged. >=20 > Modified: stable/9/sys/kern/kern_sig.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 > --- stable/9/sys/kern/kern_sig.c Mon Oct 29 03:52:18 2012 (r242282) > +++ stable/9/sys/kern/kern_sig.c Mon Oct 29 03:52:18 2012 (r242283) > @@ -1599,8 +1599,10 @@ killpg1(struct thread *td, int sig, int=20 > { > struct proc *p; > struct pgrp *pgrp; > - int nfound =3D 0; > + int err; > + int ret; > =20 > + ret =3D ESRCH; > if (all) { > /* > * broadcast > @@ -1613,11 +1615,14 @@ killpg1(struct thread *td, int sig, int=20 > PROC_UNLOCK(p); > continue; > } > - if (p_cansignal(td, p, sig) =3D=3D 0) { > - nfound++; > + err =3D p_cansignal(td, p, sig); > + if (err =3D=3D 0) { > if (sig) > pksignal(p, sig, ksi); > + ret =3D err; > } > + else if (ret =3D=3D ESRCH) > + ret =3D err; > PROC_UNLOCK(p); > } > sx_sunlock(&allproc_lock); > @@ -1644,16 +1649,19 @@ killpg1(struct thread *td, int sig, int=20 > PROC_UNLOCK(p); > continue; > } > - if (p_cansignal(td, p, sig) =3D=3D 0) { > - nfound++; > + err =3D p_cansignal(td, p, sig); > + if (err =3D=3D 0) { > if (sig) > pksignal(p, sig, ksi); > + ret =3D err; > } > + else if (ret =3D=3D ESRCH) > + ret =3D err; > PROC_UNLOCK(p); > } > PGRP_UNLOCK(pgrp); > } > - return (nfound ? 0 : ESRCH); > + return (ret); > } > =20 > #ifndef _SYS_SYSPROTO_H_ --Fnm8lRGFTVS/3GuM Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCOBukACgkQC3+MBN1Mb4iDgwCeO8ml+F6PXv1qbKW2KRR5ZYYE QrcAoPfXlJjbRSXvwG/qlHMjJ+UqzY5Y =3osD -----END PGP SIGNATURE----- --Fnm8lRGFTVS/3GuM--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121029043242.GH73505>