X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslurpd%2Fmain.c;h=9ba0a6c8be9798de800a0568226d2ee14c0130fe;hb=9568a013a8793ab5eddc2acb5c8027fb5a757a0c;hp=cc094ba44670b69580276b5c9b7d410153777dfc;hpb=72ba4cfb715001d30a6e48a2d7012f060f29d684;p=openldap diff --git a/servers/slurpd/main.c b/servers/slurpd/main.c index cc094ba446..9ba0a6c8be 100644 --- a/servers/slurpd/main.c +++ b/servers/slurpd/main.c @@ -36,9 +36,11 @@ main( return( 1 ); #else - int status; int i; + /* initialize thread package */ + ldap_pvt_thread_initialize(); + /* * Create and initialize globals. init_globals() also initializes * the main replication queue. @@ -93,9 +95,6 @@ main( #endif /* LDAP_DEBUG */ lutil_detach( 0, 0 ); - /* initialize thread package */ - ldap_pvt_thread_initialize(); - /* * Start threads - one thread for each replica */ @@ -126,9 +125,11 @@ main( for ( i = 0; sglob->replicas[ i ] != NULL; i++ ) { ldap_pvt_thread_join( sglob->replicas[ i ]->ri_tid, (void *) NULL ); } - Debug( LDAP_DEBUG_ANY, "slurpd: terminating normally\n", 0, 0, 0 ); - sglob->slurpd_shutdown = 1; + /* destroy the thread package */ + ldap_pvt_thread_destroy(); + + Debug( LDAP_DEBUG_ANY, "slurpd: terminated.\n", 0, 0, 0 ); return 0; #endif /* !NO_THREADS */ }