diff options
author | Bruno Haible <bruno@clisp.org> | 2019-12-18 10:49:44 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2019-12-18 10:49:44 +0100 |
commit | e144ded4615b8d7a77bd4f5a3f8bc309f46a78a5 (patch) | |
tree | a01471ada7762060fdd34e91ddb9796b8f3f4c64 /lib/locale.in.h | |
parent | 2d1b7501b00dce53481b58b3808313f264c720ea (diff) | |
download | gnulib-e144ded4615b8d7a77bd4f5a3f8bc309f46a78a5.tar.gz |
setlocale-null: Handle NULL result from setlocale.
* lib/locale.in.h (setlocale_null): Document EINVAL return value.
* lib/setlocale_null.c (setlocale_null_unlocked): Handle NULL result
from setlocale or _wsetlocale.
Diffstat (limited to 'lib/locale.in.h')
-rw-r--r-- | lib/locale.in.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/locale.in.h b/lib/locale.in.h index 598668308b..67e6020fab 100644 --- a/lib/locale.in.h +++ b/lib/locale.in.h @@ -228,10 +228,10 @@ _GL_WARN_ON_USE (setlocale, "setlocale works differently on native Windows - " The recommended minimum buffer size is - SETLOCALE_NULL_MAX for CATEGORY != LC_ALL, and - SETLOCALE_NULL_ALL_MAX for CATEGORY == LC_ALL. - The return value is an error code: 0 if the call is successful, ERANGE if - BUFSIZE is smaller than the length needed size (including the trailing NUL - byte). In the latter case, a truncated result is returned in BUF, but - still NUL-terminated if BUFSIZE > 0. + The return value is an error code: 0 if the call is successful, EINVAL if + CATEGORY is invalid, or ERANGE if BUFSIZE is smaller than the length needed + size (including the trailing NUL byte). In the latter case, a truncated + result is returned in BUF, but still NUL-terminated if BUFSIZE > 0. For this call to be multithread-safe, *all* calls to setlocale (CATEGORY, NULL) in all other threads must have been converted to use setlocale_null as well, and the other threads must not make other |