aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nptl/pthread_join.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nptl/pthread_join.c b/nptl/pthread_join.c
index 387f230576..84f993c700 100644
--- a/nptl/pthread_join.c
+++ b/nptl/pthread_join.c
@@ -40,7 +40,7 @@ pthread_join (threadid, thread_return)
struct pthread *pd = (struct pthread *) threadid;
/* Make sure the descriptor is valid. */
- if (DEBUGGING_P && __find_in_stack_list (pd) == NULL)
+ if ((DEBUGGING_P && __find_in_stack_list (pd) == NULL) || pd->tid <= 0)
/* Not a valid thread handle. */
return ESRCH;