From c63bdde05ed54752ed1ab756c6dd3529beb1cfd2 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 27 Nov 2007 15:27:52 +0000 Subject: [PATCH] Correctly return errors. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23004 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/libroot/posix/pthread/pthread.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/system/libroot/posix/pthread/pthread.c b/src/system/libroot/posix/pthread/pthread.c index cff6bd3c99..52611b4a63 100644 --- a/src/system/libroot/posix/pthread/pthread.c +++ b/src/system/libroot/posix/pthread/pthread.c @@ -83,9 +83,10 @@ pthread_equal(pthread_t t1, pthread_t t2) int pthread_join(pthread_t thread, void **value_ptr) { - wait_for_thread(thread, (status_t *)value_ptr); - /* the thread could be joinable and gone */ - return B_OK; + status_t error = wait_for_thread(thread, (status_t *)value_ptr); + if (error == B_BAD_THREAD_ID) + return ESRCH; + return error; }