Message ID | 547DFC81.5080204@qnx.com |
---|---|
State | New |
Headers | show |
On 12/02/14 10:53, Ryan Mansfield wrote: > Hi, > > Underlying pthread_setspecific can return non-zero with ENOMEM or EINVAL. > > 2014-12-02 Ryan Mansfield <rmansfield@qnx.com> > > * emutls.c (__emutls_get_address): Check __gthread_setspecific > returns. > > OK? OK. Sorry for the delay, Jeff
On 14-12-05 05:53 PM, Jeff Law wrote: > On 12/02/14 10:53, Ryan Mansfield wrote: >> Hi, >> >> Underlying pthread_setspecific can return non-zero with ENOMEM or EINVAL. >> >> 2014-12-02 Ryan Mansfield <rmansfield@qnx.com> >> >> * emutls.c (__emutls_get_address): Check __gthread_setspecific >> returns. >> >> OK? > OK. Thanks Jeff. Could someone please apply on my behalf? Regards, Ryan Mansfield
Index: libgcc/emutls.c =================================================================== --- libgcc/emutls.c (revision 218278) +++ libgcc/emutls.c (working copy) @@ -160,7 +160,8 @@ if (arr == NULL) abort (); arr->size = size; - __gthread_setspecific (emutls_key, (void *) arr); + if (__gthread_setspecific (emutls_key, (void *) arr) != 0) + abort (); } else if (__builtin_expect (offset > arr->size, 0)) { @@ -174,7 +175,8 @@ arr->size = size; memset (arr->data + orig_size, 0, (size - orig_size) * sizeof (void *)); - __gthread_setspecific (emutls_key, (void *) arr); + if (__gthread_setspecific (emutls_key, (void *) arr) != 0) + abort (); } void *ret = arr->data[offset - 1];