static glue_Addrec *ga_list;
/* Attach all the subordinate backends to their superior */
-static int
+int
glue_sub_attach()
{
glue_Addrec *ga, *gnext = NULL;
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();
int
glue_sub_init()
{
- int rc;
-
glue.on_bi.bi_type = "glue";
glue.on_bi.bi_db_init = glue_db_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 );
}