/* List of added subordinates */
static glue_Addrec *ga_list;
+static int ga_adding;
static int
glue_db_init(
glue_Addrec *ga, *gnext = NULL;
int rc = 0;
+ if ( ga_adding )
+ return 0;
+
+ ga_adding = 1;
+
/* For all the subordinate backends */
for ( ga=ga_list; ga != NULL; ga = gnext ) {
BackendDB *be;
/* allow this for now, assume a superior will
* be added later
*/
- if ( online )
- return 0;
+ if ( online ) {
+ rc = 0;
+ gnext = ga_list;
+ break;
+ }
rc = LDAP_NO_SUCH_OBJECT;
}
ch_free( ga );
ga_list = gnext;
+ ga_adding = 0;
+
return rc;
}