diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2002-10-11 21:04:01 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2002-10-11 21:04:01 +0000 |
| commit | e1b1aa3bc2386752e9e704175e73184ecb39b933 (patch) | |
| tree | 060f999b5a9d0c2c11f440871575ea5af991c3cf /sys/kern/kern_exec.c | |
| parent | 8523987b7355694bb86bda40bd4cba4e04afc4b5 (diff) | |
Notes
Diffstat (limited to 'sys/kern/kern_exec.c')
| -rw-r--r-- | sys/kern/kern_exec.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 784ed5c91578..0e5c94c15dd9 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -469,9 +469,9 @@ interpret: PROC_UNLOCK(p); setugidsafety(td); error = fdcheckstd(td); - PROC_LOCK(p); if (error != 0) goto done1; + PROC_LOCK(p); /* * Set the new credentials. */ @@ -543,24 +543,23 @@ interpret: oldargs = p->p_args; p->p_args = NULL; - /* Set values passed into the program in registers. */ - if (p->p_sysent->sv_setregs) - (*p->p_sysent->sv_setregs)(td, imgp->entry_addr, - (u_long)(uintptr_t)stack_base, imgp->ps_strings); - else - exec_setregs(td, imgp->entry_addr, - (u_long)(uintptr_t)stack_base, imgp->ps_strings); - /* Cache arguments if they fit inside our allowance */ if (ps_arg_cache_limit >= i + sizeof(struct pargs)) { bcopy(imgp->stringbase, newargs->ar_args, i); p->p_args = newargs; newargs = NULL; } -done1: PROC_UNLOCK(p); + /* Set values passed into the program in registers. */ + if (p->p_sysent->sv_setregs) + (*p->p_sysent->sv_setregs)(td, imgp->entry_addr, + (u_long)(uintptr_t)stack_base, imgp->ps_strings); + else + exec_setregs(td, imgp->entry_addr, + (u_long)(uintptr_t)stack_base, imgp->ps_strings); +done1: /* * Free any resources malloc'd earlier that we didn't use. */ |
