summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2006-11-28 11:05:31 +0000
committerdavidxu <davidxu@FreeBSD.org>2006-11-28 11:05:31 +0000
commit61e0842016ad2dd75f423cd81d713ea68d6e92ae (patch)
tree932a56908ed69c85dbeb7fa78866f1cb950c946d /lib/libpthread
parentf5c0caf84865fdac4b22940ab3c1de794b71ed24 (diff)
downloadFreeBSD-src-61e0842016ad2dd75f423cd81d713ea68d6e92ae.zip
FreeBSD-src-61e0842016ad2dd75f423cd81d713ea68d6e92ae.tar.gz
If a thread was detached, return EINVAL instead, the error code
is also returned by pthread_detach() if a thread was already detached, the error code was already documented: > [EINVAL] The implementation has detected that the value speci- > fied by thread does not refer to a joinable thread.
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/thread/thr_join.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libpthread/thread/thr_join.c b/lib/libpthread/thread/thr_join.c
index 1a3452e..554c5c6 100644
--- a/lib/libpthread/thread/thr_join.c
+++ b/lib/libpthread/thread/thr_join.c
@@ -80,7 +80,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) {
OpenPOWER on IntegriCloud