summaryrefslogtreecommitdiff
path: root/src/locale/locale_map.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/locale/locale_map.c')
-rw-r--r--src/locale/locale_map.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/locale/locale_map.c b/src/locale/locale_map.c
index fa51f2e3..da61f7fc 100644
--- a/src/locale/locale_map.c
+++ b/src/locale/locale_map.c
@@ -28,8 +28,8 @@ static const char envvars[][12] = {
"LC_MESSAGES",
};
-static volatile int lock[1];
-volatile int *const __locale_lockptr = lock;
+volatile int __locale_lock[1];
+volatile int *const __locale_lockptr = __locale_lock;
const struct __locale_map *__get_locale(int cat, const char *val)
{
@@ -63,14 +63,6 @@ const struct __locale_map *__get_locale(int cat, const char *val)
for (p=loc_head; p; p=p->next)
if (!strcmp(val, p->name)) return p;
- LOCK(lock);
-
- for (p=loc_head; p; p=p->next)
- if (!strcmp(val, p->name)) {
- UNLOCK(lock);
- return p;
- }
-
if (!libc.secure) path = getenv("MUSL_LOCPATH");
/* FIXME: add a default path? */
@@ -117,6 +109,5 @@ const struct __locale_map *__get_locale(int cat, const char *val)
* requested name was "C" or "POSIX". */
if (!new && cat == LC_CTYPE) new = (void *)&__c_dot_utf8;
- UNLOCK(lock);
return new;
}