diff options
author | theraven <theraven@FreeBSD.org> | 2012-07-06 20:16:22 +0000 |
---|---|---|
committer | theraven <theraven@FreeBSD.org> | 2012-07-06 20:16:22 +0000 |
commit | 3fd98197832d76ffc7a77c635b9cd424b6aa4341 (patch) | |
tree | 87cd55870dda96914d3241fd518f86304972e71c /lib/libc | |
parent | f4b6489741167c2fb99b244d549d312fd27d54f7 (diff) | |
download | FreeBSD-src-3fd98197832d76ffc7a77c635b9cd424b6aa4341.zip FreeBSD-src-3fd98197832d76ffc7a77c635b9cd424b6aa4341.tar.gz |
Restore the __collate_load_error global that was accidentally removed in the
xlocale refactoring.
MFC after: 1 week
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/locale/collate.c | 10 | ||||
-rw-r--r-- | lib/libc/locale/setrunelocale.c | 1 |
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/libc/locale/collate.c b/lib/libc/locale/collate.c index 448e605..676d41c 100644 --- a/lib/libc/locale/collate.c +++ b/lib/libc/locale/collate.c @@ -56,11 +56,11 @@ __FBSDID("$FreeBSD$"); * We also modify the collation table test functions to search the thread-local * table first and the global table second. */ -#define __collate_load_error (table->__collate_load_error) #define __collate_substitute_nontrivial (table->__collate_substitute_nontrivial) #define __collate_substitute_table_ptr (table->__collate_substitute_table_ptr) #define __collate_char_pri_table_ptr (table->__collate_char_pri_table_ptr) #define __collate_chain_pri_table (table->__collate_chain_pri_table) +int __collate_load_error; struct xlocale_collate __xlocale_global_collate = { @@ -109,7 +109,9 @@ __collate_load(const char *encoding, locale_t unused) int __collate_load_tables(const char *encoding) { - return __collate_load_tables_l(encoding, &__xlocale_global_collate); + int ret = __collate_load_tables_l(encoding, &__xlocale_global_collate); + __collate_load_error = __xlocale_global_collate.__collate_load_error; + return ret; } int @@ -123,7 +125,7 @@ __collate_load_tables_l(const char *encoding, struct xlocale_collate *table) /* 'encoding' must be already checked. */ if (strcmp(encoding, "C") == 0 || strcmp(encoding, "POSIX") == 0) { - __collate_load_error = 1; + table->__collate_load_error = 1; return (_LDP_CACHE); } @@ -240,7 +242,7 @@ __collate_load_tables_l(const char *encoding, struct xlocale_collate *table) break; } } - __collate_load_error = 0; + table->__collate_load_error = 0; return (_LDP_LOADED); } diff --git a/lib/libc/locale/setrunelocale.c b/lib/libc/locale/setrunelocale.c index f036bbc..3ffb649 100644 --- a/lib/libc/locale/setrunelocale.c +++ b/lib/libc/locale/setrunelocale.c @@ -67,7 +67,6 @@ extern _RuneLocale *_Read_RuneMagi(FILE *); static int __setrunelocale(struct xlocale_ctype *l, const char *); -#define __collate_load_error (table->__collate_load_error) #define __collate_substitute_nontrivial (table->__collate_substitute_nontrivial) #define __collate_substitute_table_ptr (table->__collate_substitute_table_ptr) #define __collate_char_pri_table_ptr (table->__collate_char_pri_table_ptr) |