From: Randy Kunkee Date: Wed, 26 Apr 2000 01:03:47 +0000 (+0000) Subject: Make slurpd work when restarting in one-shot mode. X-Git-Tag: OPENLDAP_REL_ENG_1_2_11~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b508b89c5ca9f845c89115323349c9f753d44ec;p=thirdparty%2Fopenldap.git Make slurpd work when restarting in one-shot mode. --- diff --git a/servers/slurpd/main.c b/servers/slurpd/main.c index 1510f21825..6b517f5750 100644 --- a/servers/slurpd/main.c +++ b/servers/slurpd/main.c @@ -101,15 +101,8 @@ main( #endif /* LDAP_DEBUG */ lutil_detach( 0, 0 ); - /* initialize thread package */ - ldap_pvt_thread_initialize(); - - /* - * Start threads - one thread for each replica - */ - for ( i = 0; sglob->replicas[ i ] != NULL; i++ ) { - start_replica_thread( sglob->replicas[ i ]); - } + /* initialize thread package */ + ldap_pvt_thread_initialize(); /* * Start the main file manager thread (in fm.c). @@ -123,10 +116,26 @@ main( } + /* + * wait for fm to finish if in oneshot mode + */ + if ( sglob->one_shot_mode ) { + ldap_pvt_thread_join( sglob->fm_tid, (void *) NULL ); + } + + /* + * Start threads - one thread for each replica + */ + for ( i = 0; sglob->replicas[ i ] != NULL; i++ ) { + start_replica_thread( sglob->replicas[ i ]); + } + /* * Wait for the fm thread to finish. */ - ldap_pvt_thread_join( sglob->fm_tid, (void *) NULL ); + if ( !sglob->one_shot_mode ) { + ldap_pvt_thread_join( sglob->fm_tid, (void *) NULL ); + } /* * Wait for the replica threads to finish.