diff options
author | Bruno Haible <bruno@clisp.org> | 2019-12-17 14:10:45 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2019-12-17 14:10:45 +0100 |
commit | f2b522477945905e534d9eae4315a8337612905c (patch) | |
tree | d2fea52ace759f49a0bea35a3498e250062b2d7a /m4 | |
parent | 5dbb9992fe9c872b3fb57b79a8a74161d05ea50b (diff) | |
download | gnulib-f2b522477945905e534d9eae4315a8337612905c.tar.gz |
nl_langinfo: Fix multithread-safety bug on OpenBSD 3.8.
* lib/nl_langinfo.c (ctype_codeset): Invoke setlocale_null instead of
setlocale.
* m4/nl_langinfo.m4 (gl_FUNC_NL_LANGINFO): Require
gl_FUNC_SETLOCALE_NULL. Set LIB_NL_LANGINFO.
* modules/nl_langinfo (Depends-on): Add setlocale-null.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/nl_langinfo.m4 | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/m4/nl_langinfo.m4 b/m4/nl_langinfo.m4 index 66eee41d88..c62d8e7e78 100644 --- a/m4/nl_langinfo.m4 +++ b/m4/nl_langinfo.m4 @@ -1,4 +1,4 @@ -# nl_langinfo.m4 serial 6 +# nl_langinfo.m4 serial 7 dnl Copyright (C) 2009-2019 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -10,6 +10,7 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO], AC_REQUIRE([gl_LANGINFO_H]) AC_CHECK_FUNCS_ONCE([nl_langinfo]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_FUNC_SETLOCALE_NULL]) if test $ac_cv_func_nl_langinfo = yes; then # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken. AC_CACHE_CHECK([whether YESEXPR works], @@ -50,4 +51,11 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO], else HAVE_NL_LANGINFO=0 fi + if test $HAVE_NL_LANGINFO = 0 || test $HAVE_LANGINFO_CODESET = 0; then + LIB_NL_LANGINFO="$LIB_SETLOCALE_NULL" + else + LIB_NL_LANGINFO= + fi + dnl LIB_NL_LANGINFO is expected to be empty everywhere. + AC_SUBST([LIB_NL_LANGINFO]) ]) |