Index: sys/kern/subr_syscall.c =================================================================== --- sys/kern/subr_syscall.c +++ sys/kern/subr_syscall.c @@ -95,20 +95,21 @@ if (p->p_ptevents & PTRACE_SCE) ptracestop((td), SIGTRAP, NULL); PROC_UNLOCK(p); - } - if (__predict_false((td->td_dbgflags & TDB_USERWR) != 0)) { - /* - * Reread syscall number and arguments if debugger - * modified registers or memory. - */ - error = (p->p_sysent->sv_fetch_syscall_args)(td); + + if (__predict_false((td->td_dbgflags & TDB_USERWR) != 0)) { + /* + * Reread syscall number and arguments if debugger + * modified registers or memory. + */ + error = (p->p_sysent->sv_fetch_syscall_args)(td); #ifdef KTRACE - if (KTRPOINT(td, KTR_SYSCALL)) - ktrsyscall(sa->code, sa->callp->sy_narg, sa->args); + if (KTRPOINT(td, KTR_SYSCALL)) + ktrsyscall(sa->code, sa->callp->sy_narg, sa->args); #endif - if (error != 0) { - td->td_errno = error; - goto retval; + if (error != 0) { + td->td_errno = error; + goto retval; + } } }