From ff09ba5fbbb957ac8c4ee21ae02b3900b68b8381 Mon Sep 17 00:00:00 2001 From: John Birrell Date: Thu, 25 Jun 1998 00:04:21 +0000 Subject: [PATCH] Add the missing {} that caused the function to return ESRCH if it had to wait for the thread to exit and if the caller didn't want the thread exit status. --- lib/libc_r/uthread/uthread_join.c | 3 ++- lib/libkse/thread/thr_join.c | 3 ++- lib/libpthread/thread/thr_join.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/libc_r/uthread/uthread_join.c b/lib/libc_r/uthread/uthread_join.c index 83b0c2a8c0d..2043b76f5d2 100644 --- a/lib/libc_r/uthread/uthread_join.c +++ b/lib/libc_r/uthread/uthread_join.c @@ -77,11 +77,12 @@ pthread_join(pthread_t pthread, void **thread_return) _thread_kern_sched_state(PS_JOIN, __FILE__, __LINE__); /* Check if the thread is not detached: */ - if ((pthread->attr.flags & PTHREAD_DETACHED) == 0) + if ((pthread->attr.flags & PTHREAD_DETACHED) == 0) { /* Check if the return value is required: */ if (thread_return) /* Return the thread's return value: */ *thread_return = pthread->ret; + } else /* Return an error: */ ret = ESRCH; diff --git a/lib/libkse/thread/thr_join.c b/lib/libkse/thread/thr_join.c index 83b0c2a8c0d..2043b76f5d2 100644 --- a/lib/libkse/thread/thr_join.c +++ b/lib/libkse/thread/thr_join.c @@ -77,11 +77,12 @@ pthread_join(pthread_t pthread, void **thread_return) _thread_kern_sched_state(PS_JOIN, __FILE__, __LINE__); /* Check if the thread is not detached: */ - if ((pthread->attr.flags & PTHREAD_DETACHED) == 0) + if ((pthread->attr.flags & PTHREAD_DETACHED) == 0) { /* Check if the return value is required: */ if (thread_return) /* Return the thread's return value: */ *thread_return = pthread->ret; + } else /* Return an error: */ ret = ESRCH; diff --git a/lib/libpthread/thread/thr_join.c b/lib/libpthread/thread/thr_join.c index 83b0c2a8c0d..2043b76f5d2 100644 --- a/lib/libpthread/thread/thr_join.c +++ b/lib/libpthread/thread/thr_join.c @@ -77,11 +77,12 @@ pthread_join(pthread_t pthread, void **thread_return) _thread_kern_sched_state(PS_JOIN, __FILE__, __LINE__); /* Check if the thread is not detached: */ - if ((pthread->attr.flags & PTHREAD_DETACHED) == 0) + if ((pthread->attr.flags & PTHREAD_DETACHED) == 0) { /* Check if the return value is required: */ if (thread_return) /* Return the thread's return value: */ *thread_return = pthread->ret; + } else /* Return an error: */ ret = ESRCH;