X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fmain.c;h=106617fa06f4924021837f7c4980f52153a1cf35;hb=ceb1c5ce1c22a1e062cf724d222b126751e2906a;hp=543676bda9259b70aee504321b80a8da757d2999;hpb=9918c4a0939f17eb3613d9485d171cc157691410;p=openldap diff --git a/servers/slapd/main.c b/servers/slapd/main.c index 543676bda9..106617fa06 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -39,6 +39,9 @@ pthread_mutex_t currenttime_mutex; int active_threads; pthread_mutex_t active_threads_mutex; pthread_mutex_t new_conn_mutex; +#ifdef SLAPD_CRYPT +pthread_mutex_t crypt_mutex; +#endif long ops_initiated; long ops_completed; int num_conns; @@ -172,44 +175,25 @@ main( int argc, char **argv ) read_config( configfile, &be, fp ); if ( ! inetd ) { - pthread_attr_t attr; int status; time( &starttime ); - pthread_attr_init( &attr ); -#ifdef DETACH_LISTENER_THREAD - /* we should detach it if we're going to join with it */ - pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED ); -#endif -#if !defined(HAVE_PTHREADS_D4) - /* POSIX_THREADS or compatible - * This is a draft 10 or standard pthreads implementation - */ - if ( pthread_create( &listener_tid, &attr, slapd_daemon, - (void *) port ) != 0 ) { - Debug( LDAP_DEBUG_ANY, - "listener pthread_create failed\n", 0, 0, 0 ); - exit( 1 ); - } -#else /* draft4 */ - /* - * This is a draft 4 or earlier pthreads implementation - */ - if ( pthread_create( &listener_tid, attr, slapd_daemon, + if ( pthread_create( &listener_tid, NULL, slapd_daemon, (void *) port ) != 0 ) { Debug( LDAP_DEBUG_ANY, "listener pthread_create failed\n", 0, 0, 0 ); exit( 1 ); } -#endif /* !draft4 */ - pthread_attr_destroy( &attr ); + #ifdef HAVE_PHREADS_FINAL pthread_join( listener_tid, (void *) NULL ); #else pthread_join( listener_tid, (void *) &status ); #endif - pthread_exit( 0 ); + + return 0; + } else { Connection c; Operation *o;