diff options
author | jhb <jhb@FreeBSD.org> | 2002-04-09 20:00:40 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2002-04-09 20:00:40 +0000 |
commit | 1fbf4e984847088d9678efd24e5f040ed3d8c97a (patch) | |
tree | d1e88782968c34c55510775749f2586c9ecc19f7 /sys/kern | |
parent | fc492a338c0a321710afc1fb0e1eb8cab3d78a71 (diff) | |
download | FreeBSD-src-1fbf4e984847088d9678efd24e5f040ed3d8c97a.zip FreeBSD-src-1fbf4e984847088d9678efd24e5f040ed3d8c97a.tar.gz |
We don't need Giant to read the pgrp ID since the proc lock has protected
p_pgrp since the pgrp locking went in. We also don't need it to check for
invalid values in the options argument to wait1(), so push Giant down
slightly.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_exit.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 7b409b4..db899b2 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -506,17 +506,15 @@ wait1(td, uap, compat) struct pargs *pa; int status, error; - mtx_lock(&Giant); q = td->td_proc; if (uap->pid == 0) { PROC_LOCK(q); uap->pid = -q->p_pgid; PROC_UNLOCK(q); } - if (uap->options &~ (WUNTRACED|WNOHANG|WLINUXCLONE)) { - error = EINVAL; - goto done2; - } + if (uap->options &~ (WUNTRACED|WNOHANG|WLINUXCLONE)) + return (EINVAL); + mtx_lock(&Giant); loop: nfound = 0; sx_slock(&proctree_lock); |