#ifdef USE_TLS
-static bool
+static bool __libc_freeres_fn_section
free_slotinfo (struct dtv_slotinfo_list **elemp)
{
size_t cnt;
/* There was no initial TLS setup, it was set up later when
it used the normal malloc. */
free_slotinfo (&GL(dl_tls_dtv_slotinfo_list));
+ else
# endif
- /* The first element of the list does not have to be deallocated.
- It was allocated in the dynamic linker (i.e., with a different
- malloc), and in the static library it's in .bss space. */
- free_slotinfo (&GL(dl_tls_dtv_slotinfo_list)->next);
+ /* The first element of the list does not have to be deallocated.
+ It was allocated in the dynamic linker (i.e., with a different
+ malloc), and in the static library it's in .bss space. */
+ free_slotinfo (&GL(dl_tls_dtv_slotinfo_list)->next);
}
#endif
}
#include <string.h>
#include <sys/param.h>
#include <bits/libc-lock.h>
+#include <locale/localeinfo.h>
#include <dlfcn.h>
#include <gconv_int.h>
not all memory will be freed. */
}
-static void
+static void __libc_freeres_fn_section
free_derivation (void *p)
{
struct known_derivation *deriv = (struct known_derivation *) p;
/* Free the modules mentioned. */
static void
-internal_function
+internal_function __libc_freeres_fn_section
free_modules_db (struct gconv_module *node)
{
if (node->left != NULL)
/* Free all resources if necessary. */
libc_freeres_fn (free_mem)
{
+ /* First free locale memory. This needs to be done before freeing derivations,
+ as ctype cleanup functions dereference steps arrays which we free below. */
+ _nl_locale_subfreeres ();
+
if (__gconv_alias_db != NULL)
__tdestroy (__gconv_alias_db, free);
/* Handle loading/unloading of shared object for transformation.
- Copyright (C) 1997,1998,1999,2000,2001,2002 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
/* We run this if we debug the memory allocation. */
-static void
+static void __libc_freeres_fn_section
do_release_all (void *nodep)
{
struct __gconv_loaded_object *obj = (struct __gconv_loaded_object *) nodep;
/* Subroutine of setlocale's __libc_subfreeres hook. */
extern void _nl_archive_subfreeres (void) attribute_hidden;
+/* Subroutine of gconv-db's __libc_subfreeres hook. */
+extern void _nl_locale_subfreeres (void) attribute_hidden;
+
/* Validate the contents of a locale file and set up the in-core
data structure to point into the data. This leaves the `alloc'
and `name' fields uninitialized, for the caller to fill in.
-/* Copyright (C) 1996-2001, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
result->comment_char = '#';
result->escape_char = '\\';
result->translate_strings = 1;
+ result->return_widestr = 0;
n = getdelim (&result->buf, &result->bufsize, '\n', result->fp);
if (n < 0)
-/* Copyright (C) 1991, 92, 1995-2000, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995-2000, 2002, 2003, 2004
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
}
libc_hidden_def (setlocale)
-static void
+static void __libc_freeres_fn_section
free_category (int category,
struct locale_data *here, struct locale_data *c_data)
{
}
}
-libc_freeres_fn (free_mem)
+/* This is called from iconv/gconv_db.c's free_mem, as locales must
+ be freed before freeing gconv steps arrays. */
+void __libc_freeres_fn_section
+_nl_locale_subfreeres (void)
{
#ifdef NL_CURRENT_INDIRECT
/* We don't use the loop because we want to have individual weak
{
if (req->type == INVALIDATE)
dbg_log ("\t%s (%s)", serv2str[req->type], (char *)key);
- else if (req > LASTDBREQ && req < LASTREQ)
+ else if (req->type > LASTDBREQ && req->type < LASTREQ)
dbg_log ("\t%s", serv2str[req->type]);
else
dbg_log (_("\tinvalid request type %d"), req->type);
/* Prepare to print the number. We want to use `__printf_fp' so we
have to prepare a `printf_info' structure. */
+ fp_info = *info;
fp_info.spec = 'f';
fp_info.prec = info->prec < 0 ? 3 : info->prec;
- fp_info.is_long_double = info->is_long_double;
- fp_info.is_short = info->is_short;
- fp_info.is_long = info->is_long;
- fp_info.alt = info->alt;
- fp_info.space = info->space;
- fp_info.left = info->left;
- fp_info.showsign = info->showsign;
- fp_info.group = info->group;
- fp_info.extra = info->extra;
- fp_info.pad = info->pad;
fp_info.wide = wide;
if (fp_info.left && fp_info.pad == L' ')
exit (4);
if ((mmap_data = (char *) mmap (NULL, fs.st_size, PROT_READ,
- MAP_SHARED, fd, 0)) == NULL)
+ MAP_SHARED, fd, 0)) == MAP_FAILED)
{
if (errno == ENOSYS)
exit (0);