diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-12-04 01:33:00 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-12-04 01:33:00 +0100 |
commit | ed9f866df04350bd3bf4661710eda07c02e8ff6a (patch) | |
tree | 16bde5ff761cb38e2c9451fa0d9814be1533db5d /pthread/pt-create.c | |
parent | 01a36d151b82f6034c9e8721a5f486ab95254d35 (diff) |
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.
Diffstat (limited to 'pthread/pt-create.c')
-rw-r--r-- | pthread/pt-create.c | 5 |
1 files changed, 4 insertions, 1 deletions
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 */ |