]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/main.c
Apply fixes for ITS24 & ITS26 from devel.
[openldap] / servers / slapd / main.c
index 543676bda9259b70aee504321b80a8da757d2999..106617fa06f4924021837f7c4980f52153a1cf35 100644 (file)
@@ -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;