[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FreeBSD failure in test-localename

From: Ed Maste
Subject: Re: FreeBSD failure in test-localename
Date: Wed, 12 Sep 2012 20:54:04 -0400

On 12 September 2012 19:57, Paul Eggert <address@hidden> wrote:
> On 09/12/2012 11:29 AM, Ed Maste wrote:
>> 2605        locale_t thread_locale = uselocale (NULL);
> I'm afraid you may need to be the guy to debug this.
> But if this is returning a value other than LC_GLOBAL_LOCALE
> that is a bug, no?  POSIX says uselocale (0) should
> return LC_GLOBAL_LOCALE if no thread-local locale has
> been installed.

This test is setting a thread-local locale:

  /* Check that gl_locale_name considers the thread locale.  */
    locale_t locale = newlocale (LC_ALL_MASK, "fr_FR.UTF-8", NULL);
    if (locale != NULL)
        uselocale (locale);
        name = gl_locale_name (LC_CTYPE, "LC_CTYPE");
        ASSERT (strcmp (name, "fr_FR.UTF-8") == 0);

I see what's going on here though - now that the xlocale API exists
(as of FreeBSD 9.1) HAVE_NEWLOCALE is true, but there is no FreeBSD
implementation in gl_locale_name_thread_unsafe so the function ends up

gl_locale_name_thread_unsafe (int category, const char *categoryname)
    locale_t thread_locale = uselocale (NULL);
    if (thread_locale != LC_GLOBAL_LOCALE)
  return NULL;

which of course isn't going to work well.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]