* elf/dl-close.c (_dl_close): Decrement l_opencount before
authorUlrich Drepper <drepper@redhat.com>
Mon, 7 Mar 2005 08:06:09 +0000 (08:06 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 7 Mar 2005 08:06:09 +0000 (08:06 +0000)
printing debug message.
* elf/dl-open.c (dl_open_worker): Always print the new opencount
in debug messages.

ChangeLog
elf/dl-close.c
elf/dl-open.c

index 9171f4c..b4c6e8a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-03-07  Ulrich Drepper  <drepper@redhat.com>
+
+       * 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.
+
 2005-03-06  Ulrich Drepper  <drepper@redhat.com>
 
        * elf/dl-close.c (_dl_close): Unify debug message format.
index eaf29ea..6681c5d 100644 (file)
@@ -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)
index f1fcfbc..0e06ca1 100644 (file)
@@ -282,7 +282,7 @@ dl_open_worker (void *a)
       /* Let the user know about the opencount.  */
       if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
        _dl_debug_printf ("opening file=%s [%lu]; opencount=%u\n\n",
-                         new->l_name, new->l_ns, new->l_opencount);
+                         new->l_name, new->l_ns, new->l_opencount + 1);
 
       /* If the user requested the object to be in the global namespace
         but it is not so far, add it now.  */