[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 00/11] Android compatibility
From: |
Kevin Cernekee |
Subject: |
Re: [PATCH 00/11] Android compatibility |
Date: |
Tue, 17 Feb 2015 22:14:53 -0800 |
On Tue, Feb 17, 2015 at 10:07 PM, Paul Eggert <address@hidden> wrote:
> Kevin Cernekee wrote:
>>>>
>>>> test-localename is calling strdup() on a NULL pointer returned by
>>>> >>gl_locale_name_thread(), and crashing. From reading
>>>> >>gl_locale_name_thread() it seems like NULL is a valid result. Maybe
>>>> >> we
>>>> >>need to change the test case to "return 77" on systems that are
>>>> >> unaware
>>>> >>of locales?
>>>
>>> >
>>> >
>>> >Yes, that sounds right. Can you propose a patch along those lines?
>>
>> OK. Should I just check for NULL, or is there a better test that
>> would indicate that the locale support is completely absent?
>
>
> I haven't read that part of the code, but it sounds like a NULL test would
> be good enough.
What I found is that for Android API levels < 21, gnulib correctly
detects that locale support is absent and the test becomes a no-op.
For API level >= 21, the only missing piece was obtaining an ASCII
name for the current thread's locale ("C" or "C.UTF-8"), which my
patch accomplished by checking MB_CUR_MAX. So now we don't get a NULL
pointer, and the test passes on Android.
We might still want to add a NULL check in the test program, rather
than just segfaulting.
- [PATCH 08/11] net_if: Handle content-free <net/if.h> system headers, (continued)
- [PATCH 08/11] net_if: Handle content-free <net/if.h> system headers, Kevin Cernekee, 2015/02/11
- [PATCH 07/11] linkat_nofollow: Add fallback case for cross compiling, Kevin Cernekee, 2015/02/11
- [PATCH 05/11] getugroups: Fix Android build, Kevin Cernekee, 2015/02/11
- [PATCH 09/11] signal_h: Fix Android build, Kevin Cernekee, 2015/02/11
- [PATCH 11/11] getdtablesize: Fix RLIMIT_NOFILE fallback case, Kevin Cernekee, 2015/02/11
- [PATCH 10/11] duplocale: Fix Android build of duplocale-tests, Kevin Cernekee, 2015/02/11
- Re: [PATCH 00/11] Android compatibility, Paul Eggert, 2015/02/11