From 0566f48a05ab6f7a408dcb61008c3469a84d2528 Mon Sep 17 00:00:00 2001 From: robert Date: Tue, 26 Nov 2002 17:30:55 +0000 Subject: To avoid sleeping with all sorts of resources acquired (the reported problem was a locked directory vnode), do not give the process a chance to sleep in state "stopevent" (depends on the S_EXEC bit being set in p_stops) until most resources have been released again. Approved by: re --- sys/kern/kern_exec.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sys/kern/kern_exec.c') diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 8f64cf4..8e2d03b 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -567,8 +567,6 @@ interpret: * If tracing the process, trap to debugger so breakpoints * can be set before the program executes. */ - _STOPEVENT(p, S_EXEC, 0); - if (p->p_flag & P_TRACED) psignal(p, SIGTRAP); @@ -640,8 +638,14 @@ exec_fail_dealloc: if (imgp->object) vm_object_deallocate(imgp->object); - if (error == 0) + if (error == 0) { + /* + * Stop the process here if its stop event mask has + * the S_EXEC bit set. + */ + STOPEVENT(p, S_EXEC, 0); goto done2; + } exec_fail: /* we're done here, clear P_INEXEC */ -- cgit v1.1