diff --git a/sys/kern/kern_kthread.c b/sys/kern/kern_kthread.c index aff0fe6a1c37..cb231c8c6558 100644 --- a/sys/kern/kern_kthread.c +++ b/sys/kern/kern_kthread.c @@ -254,7 +254,10 @@ kthread_add(void (*func)(void *), void *arg, struct proc *p, p = &proc0; oldtd = &thread0; } else { - oldtd = FIRST_THREAD_IN_PROC(p); + if (p == &proc0) + oldtd = &thread0; + else + oldtd = FIRST_THREAD_IN_PROC(p); } /* Initialize our td */ @@ -315,7 +318,7 @@ kthread_add(void (*func)(void *), void *arg, struct proc *p, } void -kthread_exit(int ecode) +kthread_exit(void) { thread_exit(); } diff --git a/sys/sys/kthread.h b/sys/sys/kthread.h index 2bd4b33bb36a..e4d9c5a9a5be 100644 --- a/sys/sys/kthread.h +++ b/sys/sys/kthread.h @@ -68,7 +68,7 @@ int kproc_kthread_add(void (*)(void *), void *, int kthread_add(void (*)(void *), void *, struct proc *, struct thread **, int flags, int pages, const char *, ...) __printflike(7, 8); -void kthread_exit(int) __dead2; +void kthread_exit(void) __dead2; int kthread_resume(struct thread *); void kthread_shutdown(void *, int); void kthread_start(const void *);