From 1fbf4e984847088d9678efd24e5f040ed3d8c97a Mon Sep 17 00:00:00 2001 From: jhb Date: Tue, 9 Apr 2002 20:00:40 +0000 Subject: 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. --- sys/kern/kern_exit.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'sys/kern/kern_exit.c') 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); -- cgit v1.1