From 50a3323d6c5ea0cfb5d14fe088de2eae6a0d2b7b Mon Sep 17 00:00:00 2001 From: davidxu Date: Sun, 10 Dec 2006 02:01:51 +0000 Subject: [PATCH] MFC: return EINVAL if thread was detached. --- lib/libpthread/thread/thr_join.c | 2 +- lib/libthr/thread/thr_join.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libpthread/thread/thr_join.c b/lib/libpthread/thread/thr_join.c index 9f940da0ff74..fce4c945969a 100644 --- a/lib/libpthread/thread/thr_join.c +++ b/lib/libpthread/thread/thr_join.c @@ -77,7 +77,7 @@ _pthread_join(pthread_t pthread, void **thread_return) THR_SCHED_UNLOCK(curthread, pthread); /* Remove the reference and return an error: */ _thr_ref_delete(curthread, pthread); - ret = ESRCH; + ret = EINVAL; } else { /* Lock the target thread while checking its state. */ if (pthread->state == PS_DEAD) { diff --git a/lib/libthr/thread/thr_join.c b/lib/libthr/thread/thr_join.c index 5b70391b4abd..26c2c325d406 100644 --- a/lib/libthr/thread/thr_join.c +++ b/lib/libthr/thread/thr_join.c @@ -84,7 +84,7 @@ join_common(pthread_t pthread, void **thread_return, if ((ret = _thr_find_thread(curthread, pthread, 1)) != 0) { ret = ESRCH; } else if ((pthread->tlflags & TLFLAGS_DETACHED) != 0) { - ret = ESRCH; + ret = EINVAL; } else if (pthread->joiner != NULL) { /* Multiple joiners are not supported. */ ret = ENOTSUP;