From b8ec72d947a1494db06552d31b3a637ccab79b31 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 8 Mar 2004 07:58:18 +0000 Subject: Update. 2004-03-07 Ulrich Drepper * idn-stub.c: Include . Use LIBCIDN_SO for dlopen. * shlib-versions: New file. * toutf8.c: Include . --- libidn/ChangeLog | 6 ++++++ libidn/idn-stub.c | 28 ++++++++++++++++++++-------- libidn/shlib-versions | 1 + libidn/toutf8.c | 1 + 4 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 libidn/shlib-versions (limited to 'libidn') diff --git a/libidn/ChangeLog b/libidn/ChangeLog index e5c0529..7321197 100644 --- a/libidn/ChangeLog +++ b/libidn/ChangeLog @@ -1,3 +1,9 @@ +2004-03-07 Ulrich Drepper + + * idn-stub.c: Include . Use LIBCIDN_SO for dlopen. + * shlib-versions: New file. + * toutf8.c: Include . + 2004-03-07 Simon Josefsson * Banner: New file. diff --git a/libidn/idn-stub.c b/libidn/idn-stub.c index f2a1161..1e5cc1f 100644 --- a/libidn/idn-stub.c +++ b/libidn/idn-stub.c @@ -23,6 +23,8 @@ #include #include #include +#include +#include /* Get specification for idna_to_ascii_lz. */ #include "idna.h" @@ -53,20 +55,30 @@ __idna_to_ascii_lz (const char *input, char **output, int flags) if (h == NULL) { - h = __libc_dlopen ("libcidn.so"); + __libc_lock_define_initialized (static, lock); + __libc_lock_lock (lock); + + /* Retest in case some other thread arrived here at the same time. */ if (h == NULL) - h = (void *) 1l; - else { - /* Get the function we are interested in. */ - to_ascii_lz = __libc_dlsym (h, "idna_to_ascii_lz"); - if (to_ascii_lz == NULL) + h = __libc_dlopen (LIBCIDN_SO); + + if (h == NULL) + h = (void *) 1l; + else { - __libc_dlclose (h); - h = (void *) 1l; + /* Get the function we are interested in. */ + to_ascii_lz = __libc_dlsym (h, "idna_to_ascii_lz"); + if (to_ascii_lz == NULL) + { + __libc_dlclose (h); + h = (void *) 1l; + } } } + + __libc_lock_unlock (lock); } if (h == (void *) 1l) diff --git a/libidn/shlib-versions b/libidn/shlib-versions new file mode 100644 index 0000000..9b27e51 --- /dev/null +++ b/libidn/shlib-versions @@ -0,0 +1 @@ +.*-.*-.* libcidn=1 diff --git a/libidn/toutf8.c b/libidn/toutf8.c index 450cb6d..d16efdb 100644 --- a/libidn/toutf8.c +++ b/libidn/toutf8.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "stringprep.h" -- cgit v1.1