diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2690,7 +2690,7 @@ struct sysent *se; register_t rv_saved[2]; unsigned int sc; - int error, nerror; + int nerror; bool audited, sy_thr_static; sc = tsr->ts_sa.code; @@ -2734,12 +2734,8 @@ audited = AUDIT_SYSCALL_ENTER(sc, td) != 0; if (!sy_thr_static) { - error = syscall_thread_enter(td, &se); + syscall_thread_enter(td, &se); sy_thr_static = (se->sy_thrcnt & SY_THR_STATIC) != 0; - if (error != 0) { - tsr->ts_ret.sr_error = error; - return; - } } rv_saved[0] = td->td_retval[0]; diff --git a/sys/kern/kern_syscalls.c b/sys/kern/kern_syscalls.c --- a/sys/kern/kern_syscalls.c +++ b/sys/kern/kern_syscalls.c @@ -88,7 +88,7 @@ pause("scdrn", hz/2); } -int +void syscall_thread_enter(struct thread *td, struct sysent **se) { uint32_t cnt, oldcnt; @@ -100,11 +100,10 @@ oldcnt = (*se)->sy_thrcnt; if ((oldcnt & (SY_THR_DRAINING | SY_THR_ABSENT)) != 0) { *se = &nosys_sysent; - return (0); + break; } cnt = oldcnt + SY_THR_INCR; } while (atomic_cmpset_acq_32(&(*se)->sy_thrcnt, oldcnt, cnt) == 0); - return (0); } void diff --git a/sys/kern/subr_syscall.c b/sys/kern/subr_syscall.c --- a/sys/kern/subr_syscall.c +++ b/sys/kern/subr_syscall.c @@ -146,12 +146,8 @@ if (__predict_false(AUDIT_SYSCALL_ENABLED() || SYSTRACE_ENABLED() || !sy_thr_static)) { if (!sy_thr_static) { - error = syscall_thread_enter(td, &se); + syscall_thread_enter(td, &se); sy_thr_static = (se->sy_thrcnt & SY_THR_STATIC) != 0; - if (error != 0) { - td->td_errno = error; - goto retval; - } } #ifdef KDTRACE_HOOKS diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -328,7 +328,7 @@ int lkmnosys(struct thread *, struct nosys_args *); int lkmressys(struct thread *, struct nosys_args *); -int syscall_thread_enter(struct thread *td, struct sysent **se); +void syscall_thread_enter(struct thread *td, struct sysent **se); void syscall_thread_exit(struct thread *td, struct sysent *se); int shared_page_alloc(int size, int align);