]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/backglue.c
ITS#4088 force cursors to use same locker
[openldap] / servers / slapd / backglue.c
index e2220fa826096d5e43cab3f2359345dbf36c4aae..bc17618b36bf29a0f08acab01865199ae424380a 100644 (file)
@@ -837,7 +837,7 @@ typedef struct glue_Addrec {
 static glue_Addrec *ga_list;
 
 /* Attach all the subordinate backends to their superior */
-static int
+int
 glue_sub_attach()
 {
        glue_Addrec *ga, *gnext = NULL;
@@ -909,16 +909,9 @@ glue_sub_add( BackendDB *be, int advert, int online )
                SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_GLUE_ADVERTISE;
 
        ga = ch_malloc( sizeof( glue_Addrec ));
-       ga->ga_next = NULL;
+       ga->ga_next = ga_list;
        ga->ga_be = be;
-       if ( ga_list ) {
-               glue_Addrec *g2 = ga_list;
-
-               for ( ; g2 && g2->ga_next; g2=g2->ga_next );
-               g2->ga_next = ga;
-       } else {
-               ga_list = ga;
-       }
+       ga_list = ga;
 
        if ( online )
                rc = glue_sub_attach();
@@ -929,8 +922,6 @@ glue_sub_add( BackendDB *be, int advert, int online )
 int
 glue_sub_init()
 {
-       int rc;
-
        glue.on_bi.bi_type = "glue";
 
        glue.on_bi.bi_db_init = glue_db_init;
@@ -946,8 +937,5 @@ glue_sub_init()
        glue.on_bi.bi_chk_referrals = glue_chk_referrals;
        glue.on_bi.bi_chk_controls = glue_chk_controls;
 
-       rc = overlay_register( &glue );
-       if ( rc ) return rc;
-
-       return glue_sub_attach();
+       return overlay_register( &glue );
 }