about summary refs log tree commit diff
path: root/elf/dl-close.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-03-07 08:06:09 +0000
committerUlrich Drepper <drepper@redhat.com>2005-03-07 08:06:09 +0000
commit21745dfa6111504005b89210828335d3816ed1f4 (patch)
tree3694e196eab1ac4cf3deb69961ccc579a104e329 /elf/dl-close.c
parentd8505f90bf57bd6fba73242ab463fcbda02582da (diff)
downloadglibc-21745dfa6111504005b89210828335d3816ed1f4.tar.gz
glibc-21745dfa6111504005b89210828335d3816ed1f4.tar.xz
glibc-21745dfa6111504005b89210828335d3816ed1f4.zip
* elf/dl-close.c (_dl_close): Decrement l_opencount before
	printing debug message.
	* elf/dl-open.c (dl_open_worker): Always print the new opencount
	in debug messages.
Diffstat (limited to 'elf/dl-close.c')
-rw-r--r--elf/dl-close.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/elf/dl-close.c b/elf/dl-close.c
index eaf29ea99f..6681c5d3e7 100644
--- a/elf/dl-close.c
+++ b/elf/dl-close.c
@@ -138,14 +138,14 @@ _dl_close (void *_map)
   /* Decrement the reference count.  */
   if (map->l_opencount > 1 || map->l_type != lt_loaded)
     {
+      /* Decrement the object's reference counter, not the dependencies'.  */
+      --map->l_opencount;
+
       /* There are still references to this object.  Do nothing more.  */
       if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
 	_dl_debug_printf ("\nclosing file=%s; opencount=%u\n",
 			  map->l_name, map->l_opencount);
 
-      /* Decrement the object's reference counter, not the dependencies'.  */
-      --map->l_opencount;
-
       /* If the direct use counter reaches zero we have to decrement
 	 all the dependencies' usage counter.  */
       if (map->l_direct_opencount == 0)