Listener **slap_listeners = NULL;
static volatile sig_atomic_t listening = 1; /* 0 when slap_listeners closed */
+static ldap_pvt_thread_t *listener_tid;
#ifndef SLAPD_LISTEN_BACKLOG
#define SLAPD_LISTEN_BACKLOG 1024
int l;
time_t last_idle_check = 0;
int ebadf = 0;
- int tid = *(int *)ptr;
+ int tid = (ldap_pvt_thread_t *) ptr - listener_tid;
#define SLAPD_IDLE_CHECK_LIMIT 4
slapd_daemon( void )
{
int i, rc;
- ldap_pvt_thread_t *listener_tid;
#ifdef LDAP_CONNECTIONLESS
connectionless_init();
{
/* listener as a separate THREAD */
rc = ldap_pvt_thread_create( &listener_tid[i],
- 0, slapd_daemon_task, (void *)&i );
+ 0, slapd_daemon_task, &listener_tid[i] );
if ( rc != 0 ) {
Debug( LDAP_DEBUG_ANY,
destroy_listeners();
ch_free( listener_tid );
+ listener_tid = NULL;
return 0;
}