Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
	* iconv/gconv_conf.c (insert_module): Take extra parameter to decide
	whether the new record should be freed if it's a duplicate.
	(add_module): Adjust insert_module call.
	(__gconv_read_conf): Likewise.
	* iconvdata/Makefile (generated): Add tst-loading.mtrace and
	mtrace-tst-loading.
	(tests): Make $(objpfx)mtrace-tst-loading a dependency.  Add rule.
  • Loading branch information
Ulrich Drepper committed Aug 31, 2000
1 parent f55727c commit b2fe29d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
2000-08-30 Ulrich Drepper <drepper@redhat.com>

* iconv/gconv_conf.c (insert_module): Take extra parameter to decide
whether the new record should be freed if it's a duplicate.
(add_module): Adjust insert_module call.
(__gconv_read_conf): Likewise.
* iconvdata/Makefile (generated): Add tst-loading.mtrace and
mtrace-tst-loading.
(tests): Make $(objpfx)mtrace-tst-loading a dependency. Add rule.

* sysdeps/generic/ldsodefs.h: Add declaration for _dl_all_dirs and
_dl_all_init_dirs.
* include/link.h (struct r_search_path_struct): New.
Expand Down
14 changes: 9 additions & 5 deletions iconv/gconv_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ add_alias (char *rp, void *modules)
/* Insert a data structure for a new module in the search tree. */
static inline void
internal_function
insert_module (struct gconv_module *newp)
insert_module (struct gconv_module *newp, int tobefreed)
{
struct gconv_module **rootp = &__gconv_modules_db;

Expand All @@ -194,8 +194,12 @@ insert_module (struct gconv_module *newp)
}

if (root != NULL)
/* This is a no new conversion. */
return;
{
/* This is a no new conversion. */
if (tobefreed)
free (newp);
return;
}

break;
}
Expand Down Expand Up @@ -324,7 +328,7 @@ add_module (char *rp, const char *directory, size_t dir_len, void **modules,
memcpy (tmp - 1, gconv_module_ext, sizeof (gconv_module_ext));

/* Now insert the new module data structure in our search tree. */
insert_module (new_module);
insert_module (new_module, 1);
}
}

Expand Down Expand Up @@ -529,7 +533,7 @@ __gconv_read_conf (void)
/* It'll conflict so don't add it. */
continue;

insert_module (&builtin_modules[cnt]);
insert_module (&builtin_modules[cnt], 0);
}

/* Add aliases for builtin conversions. */
Expand Down
8 changes: 6 additions & 2 deletions iconvdata/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ generated-modules := $(gen-8bit-modules) $(gen-8bit-gap-modules) \
$(gen-special-modules)

generated = $(generated-modules:=.h) $(generated-modules:=.stmp) \
iconv-test.out iconv-rules
iconv-test.out iconv-rules tst-loading.mtrace mtrace-tst-loading
ifdef objpfx
generated += gconv-modules
endif
Expand Down Expand Up @@ -244,10 +244,14 @@ include ../Rules

ifeq (no,$(cross-compiling))
ifeq (yes,$(build-shared))
tests: $(objpfx)iconv-test.out
tests: $(objpfx)iconv-test.out $(objpfx)mtrace-tst-loading
endif
endif

tst-loading-ENV = MALLOC_TRACE=$(objpfx)tst-loading.mtrace
$(objpfx)mtrace-tst-loading: $(objpfx)tst-loading.out
$(common-objpfx)malloc/mtrace $(objpfx)tst-loading.mtrace > $@

$(objpfx)bug-iconv1.out: $(objpfx)gconv-modules

$(objpfx)iconv-test.out: run-iconv-test.sh $(objpfx)gconv-modules \
Expand Down

0 comments on commit b2fe29d

Please sign in to comment.