Return ESRCH if the target process is not inferior to the curproc.

Spotted by:	HIROSHI OOTA <oota@LSi.nec.co.jp>
This commit is contained in:
Seigo Tanimura 2002-02-27 10:38:14 +00:00
parent e6be967434
commit 2f9325870d

View File

@ -470,6 +470,7 @@ setpgid(td, uap)
if (!inferior(targp)) {
PROC_UNLOCK(targp);
sx_sunlock(&proctree_lock);
error = ESRCH;
goto fail;
}
sx_sunlock(&proctree_lock);
@ -529,6 +530,7 @@ setpgid(td, uap)
PGRPSESS_XUNLOCK();
KASSERT(newpgrp != NULL, ("setpgid failed and newpgrp is null."));
KASSERT(error != 0, ("setpgid successfully failed?"));
FREE(newpgrp, M_PGRP);
mtx_unlock(&Giant);