diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-12-27 19:01:57 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-12-27 19:01:57 +0000 |
commit | cab56836b146bc129f1ad43f0393d95a9deca63a (patch) | |
tree | 4f4e655319bbac78fca170da05275c127429b460 /sysdeps/mach/strerror_l.c | |
parent | 04ac1241a4cd004872282c2c82ec37fa33925292 (diff) | |
parent | 82dd75a7f436a19047325d62182590c9f9e23a78 (diff) |
Merge branch 't/tls' into refs/top-bases/t/tls-threadvar
Diffstat (limited to 'sysdeps/mach/strerror_l.c')
-rw-r--r-- | sysdeps/mach/strerror_l.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sysdeps/mach/strerror_l.c b/sysdeps/mach/strerror_l.c index e93e82f42e..7111124439 100644 --- a/sysdeps/mach/strerror_l.c +++ b/sysdeps/mach/strerror_l.c @@ -1,5 +1,5 @@ /* strerror_l - Get errno description string in given locale. Mach version. - Copyright (C) 2007-2016 Free Software Foundation, Inc. + Copyright (C) 2007-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -24,6 +24,7 @@ #include <mach/error.h> #include <errorlib.h> #include <sys/param.h> +#include <libc-symbols.h> static __thread char *last_value; @@ -86,16 +87,10 @@ strerror_l (int errnum, locale_t loc) return (char *) translate (es->subsystem[sub].codes[code], loc); } - -#ifdef _LIBC -# ifdef _LIBC_REENTRANT /* This is called when a thread is exiting to free the last_value string. */ -static void __attribute__ ((section ("__libc_thread_freeres_fn"))) -strerror_thread_freeres (void) +void +__strerror_thread_freeres (void) { free (last_value); } -text_set_element (__libc_thread_subfreeres, strerror_thread_freeres); -text_set_element (__libc_subfreeres, strerror_thread_freeres); -# endif -#endif +text_set_element (__libc_subfreeres, __strerror_thread_freeres); |