X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fmain.c;h=106617fa06f4924021837f7c4980f52153a1cf35;hb=ceb1c5ce1c22a1e062cf724d222b126751e2906a;hp=76f8cd9acd2531fc56283f0c5291e53dc6dc8faf;hpb=0a7ca1e8d2f575f1a0c65932eb1e26136656c128;p=openldap diff --git a/servers/slapd/main.c b/servers/slapd/main.c index 76f8cd9acd..106617fa06 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -175,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, + 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 ); } -#else /* draft4 */ - /* - * This is a draft 4 or earlier 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 ); - } -#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;