summaryrefslogtreecommitdiff
path: root/string/strerror_l.c
diff options
context:
space:
mode:
Diffstat (limited to 'string/strerror_l.c')
-rw-r--r--string/strerror_l.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/string/strerror_l.c b/string/strerror_l.c
index 13f7606c3e..2a62b1f12c 100644
--- a/string/strerror_l.c
+++ b/string/strerror_l.c
@@ -1,4 +1,4 @@
-/* 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
@@ -21,7 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/param.h>
-
+#include <libc-symbols.h>
static __thread char *last_value;
@@ -56,16 +56,9 @@ strerror_l (int errnum, locale_t loc)
return (char *) translate (_sys_errlist_internal[errnum], 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);