From ed9f866df04350bd3bf4661710eda07c02e8ff6a Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 4 Dec 2014 01:33:00 +0100 Subject: Fix pthread_create return value on TLS allocation failure * pthread/pt-create.c (__pthread_create_internal): When _dl_allocate_tls returns NULL, set `err' to ENOMEM. --- pthread/pt-create.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pthread') diff --git a/pthread/pt-create.c b/pthread/pt-create.c index 386891e..8b95a4b 100644 --- a/pthread/pt-create.c +++ b/pthread/pt-create.c @@ -151,7 +151,10 @@ __pthread_create_internal (struct __pthread **thread, #ifdef ENABLE_TLS pthread->tcb = _dl_allocate_tls (NULL); if (!pthread->tcb) - goto failed_thread_tls_alloc; + { + err = ENOMEM; + goto failed_thread_tls_alloc; + } pthread->tcb->tcb = pthread->tcb; #endif /* ENABLE_TLS */ -- cgit v1.2.3