#endif /* LOG_LOCAL4 */
-/*
- * the server's name must be accessible from the daemon module,
- * to construct the pid/args file names
- */
-char *serverName = NULL;
-
static void
usage( char *name )
int syslogUser = DEFAULT_SYSLOG_USER;
#endif
char *configfile;
+ char *serverName;
configfile = SLAPD_DEFAULT_CONFIGFILE;
port = LDAP_PORT;
time( &starttime );
- if ( status = pthread_create( &listener_tid, NULL,
+ if ( status = ldap_pvt_thread_create( &listener_tid, 0,
slapd_daemon, (void *) port ) != 0 )
{
Debug( LDAP_DEBUG_ANY,
- "listener pthread_create failed (%d)\n", status, 0, 0 );
+ "listener ldap_pvt_thread_create failed (%d)\n", status, 0, 0 );
exit( 1 );
}
-#ifdef HAVE_PHREADS_FINAL
- pthread_join( listener_tid, (void *) NULL );
-#else
- pthread_join( listener_tid, (void *) &status );
-#endif
+ /* wait for the listener thread to complete */
+ ldap_pvt_thread_join( listener_tid, (void *) NULL );
return 0;
struct hostent *hp;
c.c_dn = NULL;
+ c.c_cdn = NULL;
c.c_ops = NULL;
c.c_sb.sb_sd = 0;
c.c_sb.sb_options = 0;
c.c_sb.sb_ber.ber_buf = NULL;
c.c_sb.sb_ber.ber_ptr = NULL;
c.c_sb.sb_ber.ber_end = NULL;
- pthread_mutex_init( &c.c_dnmutex, pthread_mutexattr_default );
- pthread_mutex_init( &c.c_opsmutex, pthread_mutexattr_default );
- pthread_mutex_init( &c.c_pdumutex, pthread_mutexattr_default );
+ ldap_pvt_thread_mutex_init( &c.c_dnmutex );
+ ldap_pvt_thread_mutex_init( &c.c_opsmutex );
+ ldap_pvt_thread_mutex_init( &c.c_pdumutex );
#ifdef notdefcldap
c.c_sb.sb_addrs = (void **) saddrlist;
c.c_sb.sb_fromaddr = &faddr;
while ( (tag = ber_get_next( &c.c_sb, &len, &ber ))
== LDAP_TAG_MESSAGE ) {
- pthread_mutex_lock( ¤ttime_mutex );
+ ldap_pvt_thread_mutex_lock( ¤ttime_mutex );
time( ¤ttime );
- pthread_mutex_unlock( ¤ttime_mutex );
+ ldap_pvt_thread_mutex_unlock( ¤ttime_mutex );
if ( (tag = ber_get_int( &ber, &msgid ))
!= LDAP_TAG_MSGID ) {