Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 Dec 2025 18:28:38 +0000
From:      Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav <des@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 8787b699b036 - stable/14 - libc: Simplify __get_locale()
Message-ID:  <69332456.cb7d.4edc73bd@gitrepo.freebsd.org>

index | next in thread | raw e-mail

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);
 }
 
 /**


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69332456.cb7d.4edc73bd>