]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
iconv: Use __twalk_r in __gconv_release_shlib
authorFlorian Weimer <fweimer@redhat.com>
Tue, 4 Jun 2019 12:05:44 +0000 (14:05 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 4 Jun 2019 12:13:44 +0000 (14:13 +0200)
ChangeLog
iconv/gconv_dl.c

index 0d749e32266b2dfebf2074fe9ac36ae25cbf9b40..d15a68a3cd0dd0bc9f58a6c4b3fd379eec1edccb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-06-04  Florian Weimer  <fweimer@redhat.com>
+
+       * iconv/gconv_dl.c (release_handle): Remove file-level definition.
+       (do_release_shlib): Adjust for __twalk_r.
+       (__gconv_release_shlib): Call __twalk_r.
+
 2019-06-04  Andreas Schwab  <schwab@suse.de>
 
        [BZ #18830]
index cf7023a9aac443237da3de32b972232f7ac2c9f0..c0342d8f507157160c4bd34614b60ca8e770dbf5 100644 (file)
@@ -149,15 +149,10 @@ __gconv_find_shlib (const char *name)
   return found;
 }
 
-
-/* This is very ugly but the tsearch functions provide no way to pass
-   information to the walker function.  So we use a global variable.
-   It is MT safe since we use a lock.  */
-static struct __gconv_loaded_object *release_handle;
-
 static void
-do_release_shlib (void *nodep, VISIT value, int level)
+do_release_shlib (const void *nodep, VISIT value, void *closure)
 {
+  struct __gconv_loaded_object *release_handle = closure;
   struct __gconv_loaded_object *obj = *(struct __gconv_loaded_object **) nodep;
 
   if (value != preorder && value != leaf)
@@ -184,13 +179,10 @@ do_release_shlib (void *nodep, VISIT value, int level)
 void
 __gconv_release_shlib (struct __gconv_loaded_object *handle)
 {
-  /* Urgh, this is ugly but we have no other possibility.  */
-  release_handle = handle;
-
   /* Process all entries.  Please note that we also visit entries
      with release counts <= 0.  This way we can finally unload them
      if necessary.  */
-  __twalk (loaded, (__action_fn_t) do_release_shlib);
+  __twalk_r (loaded, do_release_shlib, handle);
 }