From bd6daf3b198cb5b06d677333d476b89d8e699c2f Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 22 Oct 2002 16:11:43 +0000 Subject: * locale/programs/locarchive.c (add_alias): Change locrec_offset arg into pointer to locrec_offset. (add_locale_to_archive): Adjust callers. Free normalized_name right before returning, not immediately after add_locale, pass it to add_alias if not NULL instead of name. Rename second normalized_name occurence to nnormalized_codeset_name. 2002-10-21 Andreas Schwab * sysdeps/unix/sysv/linux/ia64/syscalls.list (s_execve): Set caller to EXTRA instead of execve, since the latter has a higher-priority implementation in linuxthreads. --- ChangeLog | 19 +++++++++++++------ linuxthreads/ChangeLog | 5 +++++ linuxthreads/manager.c | 2 +- locale/programs/locarchive.c | 21 +++++++++++++-------- 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6128e454d8..91f79f6a5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,15 +1,22 @@ -2002-10-21 Andreas Schwab - - * sysdeps/unix/sysv/linux/ia64/syscalls.list (s_execve): Set - caller to EXTRA instead of execve, since the latter has a - higher-priority implementation in linuxthreads. - 2002-10-22 Jakub Jelinek + * locale/programs/locarchive.c (add_alias): Change locrec_offset arg + into pointer to locrec_offset. + (add_locale_to_archive): Adjust callers. Free normalized_name right + before returning, not immediately after add_locale, pass it to + add_alias if not NULL instead of name. Rename second normalized_name + occurence to nnormalized_codeset_name. + * locale/programs/locarchive.c (enlarge_archive): Make sure string_size is always a multiple of 4. Reported by Andreas Schwab . +2002-10-21 Andreas Schwab + + * sysdeps/unix/sysv/linux/ia64/syscalls.list (s_execve): Set + caller to EXTRA instead of execve, since the latter has a + higher-priority implementation in linuxthreads. + 2002-10-21 Roland McGrath * sysdeps/generic/libc-tls.c (__libc_setup_tls): Initialize the static diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog index 6b185a02e8..1e069044ee 100644 --- a/linuxthreads/ChangeLog +++ b/linuxthreads/ChangeLog @@ -1,3 +1,8 @@ +2002-10-22 Jakub Jelinek + + * manager.c (pthread_start_thread): Call __uselocale even + if [! SHARED]. Patch by Leon Kanter . + 2002-10-17 Roland McGrath * Makefile (unload): Don't link in libpthread.so. diff --git a/linuxthreads/manager.c b/linuxthreads/manager.c index cb9c33ecfb..1d21760cf9 100644 --- a/linuxthreads/manager.c +++ b/linuxthreads/manager.c @@ -283,7 +283,7 @@ pthread_start_thread(void *arg) __sched_setscheduler(THREAD_GETMEM(self, p_pid), SCHED_OTHER, &default_params); } -#if !(USE_TLS && HAVE___THREAD) && defined SHARED +#if !(USE_TLS && HAVE___THREAD) /* Initialize thread-locale current locale to point to the global one. With __thread support, the variable's initializer takes care of this. */ __uselocale (LC_GLOBAL_LOCALE); diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c index abb6cd28e1..10017a214e 100644 --- a/locale/programs/locarchive.c +++ b/locale/programs/locarchive.c @@ -586,8 +586,9 @@ insert_name (struct locarhandle *ah, static void add_alias (struct locarhandle *ah, const char *alias, bool replace, - const char *oldname, uint32_t locrec_offset) + const char *oldname, uint32_t *locrec_offset_p) { + uint32_t locrec_offset = *locrec_offset_p; struct locarhead *head = ah->addr; const size_t name_len = strlen (alias); struct namehashent *namehashent = insert_name (ah, alias, strlen (alias), @@ -610,10 +611,10 @@ add_alias (struct locarhandle *ah, const char *alias, bool replace, namehashent = insert_name (ah, oldname, strlen (oldname), true); assert (namehashent->name_offset != 0); assert (namehashent->locrec_offset != 0); - locrec_offset = namehashent->locrec_offset; + *locrec_offset_p = namehashent->locrec_offset; /* Tail call to try the whole thing again. */ - add_alias (ah, alias, replace, oldname, locrec_offset); + add_alias (ah, alias, replace, oldname, locrec_offset_p); return; } @@ -935,9 +936,9 @@ add_locale_to_archive (ah, name, data, replace) /* This call does the main work. */ locrec_offset = add_locale (ah, normalized_name ?: name, data, replace); - free (normalized_name); if (locrec_offset == 0) { + free (normalized_name); if (mask & XPG_NORM_CODESET) free ((char *) normalized_codeset); return -1; @@ -956,17 +957,19 @@ add_locale_to_archive (ah, name, data, replace) } *filedata = data[LC_CTYPE].addr; codeset = (char *) filedata + filedata->strindex[_NL_ITEM_INDEX (_NL_CTYPE_CODESET_NAME)]; + char *normalized_codeset_name = NULL; normalized_codeset = _nl_normalize_codeset (codeset, strlen (codeset)); mask |= XPG_NORM_CODESET; - asprintf (&normalized_name, "%s%s%s.%s%s%s", + asprintf (&normalized_codeset_name, "%s%s%s.%s%s%s", language, territory == NULL ? "" : "_", territory ?: "", normalized_codeset, modifier == NULL ? "" : "@", modifier ?: ""); - add_alias (ah, normalized_name, replace, name, locrec_offset); - free (normalized_name); + add_alias (ah, normalized_codeset_name, replace, + normalized_name ?: name, &locrec_offset); + free (normalized_codeset_name); } /* Now read the locale.alias files looking for lines whose @@ -1064,7 +1067,7 @@ add_locale_to_archive (ah, name, data, replace) && !strcmp (modifier ?: "", rhs_modifier ?: "")) /* We have a winner. */ add_alias (ah, alias, replace, - normalized_name ?: name, locrec_offset); + normalized_name ?: name, &locrec_offset); if (rhs_mask & XPG_NORM_CODESET) free ((char *) rhs_normalized_codeset); } @@ -1086,6 +1089,8 @@ add_locale_to_archive (ah, name, data, replace) fclose (fp); } + free (normalized_name); + if (mask & XPG_NORM_CODESET) free ((char *) normalized_codeset); -- cgit 1.4.1