git: 8787b699b036 - stable/14 - libc: Simplify __get_locale()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 05 Dec 2025 18:28:38 UTC
The branch stable/14 has been updated by des:
URL: https://cgit.FreeBSD.org/src/commit/?id=8787b699b036bdd99ee42a98577a7a291da9ab91
commit 8787b699b036bdd99ee42a98577a7a291da9ab91
Author: Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2025-11-26 16:54:52 +0000
Commit: Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2025-12-05 10:58:57 +0000
libc: Simplify __get_locale()
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: fuz
Differential Revision: https://reviews.freebsd.org/D53908
(cherry picked from commit 5af240c54bd2d9548536c904e841499e1651bcc8)
---
lib/libc/locale/xlocale_private.h | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/libc/locale/xlocale_private.h b/lib/libc/locale/xlocale_private.h
index ef1a8687a376..4cb323d5fa4c 100644
--- a/lib/libc/locale/xlocale_private.h
+++ b/lib/libc/locale/xlocale_private.h
@@ -200,11 +200,9 @@ extern _Thread_local locale_t __thread_locale;
*/
static inline locale_t __get_locale(void)
{
-
- if (!__has_thread_locale) {
+ if (!__has_thread_locale || __thread_locale == NULL)
return (&__xlocale_global_locale);
- }
- return (__thread_locale ? __thread_locale : &__xlocale_global_locale);
+ return (__thread_locale);
}
/**