about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-05-11 21:34:32 +0000
committerUlrich Drepper <drepper@redhat.com>2007-05-11 21:34:32 +0000
commit9b0d1c0236d5dc61f2e1574078e48ec0188e384a (patch)
treeef7821f99209103f5c215f6ad478b9ea56da5969 /elf
parent2e81d44986d19da523810cd54bf43aa7cdfec39a (diff)
downloadglibc-9b0d1c0236d5dc61f2e1574078e48ec0188e384a.tar.gz
glibc-9b0d1c0236d5dc61f2e1574078e48ec0188e384a.tar.xz
glibc-9b0d1c0236d5dc61f2e1574078e48ec0188e384a.zip
(add_to_global): One more small cleanup patch.
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-open.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/elf/dl-open.c b/elf/dl-open.c
index 0df62ff51e..583878781e 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -137,7 +137,7 @@ add_to_global (struct link_map *new)
     }
 
   /* Now add the new entries.  */
-  unsigned int added = 0;
+  unsigned int new_nlist = ns->_ns_main_searchlist->r_nlist;
   for (cnt = 0; cnt < new->l_searchlist.r_nlist; ++cnt)
     {
       struct link_map *map = new->l_searchlist.r_list[cnt];
@@ -145,14 +145,11 @@ add_to_global (struct link_map *new)
       if (map->l_global == 0)
 	{
 	  map->l_global = 1;
-	  ns->_ns_main_searchlist->r_list[ns->_ns_main_searchlist->r_nlist
-					  + added]
-	    = map;
-	  ++added;
+	  ns->_ns_main_searchlist->r_list[new_nlist++] = map;
 	}
     }
   atomic_write_barrier ();
-  ns->_ns_main_searchlist->r_nlist += added;
+  ns->_ns_main_searchlist->r_nlist = new_nlist;
 
   return 0;
 }