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:
parent
e6be967434
commit
2f9325870d
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user