-#define DISABLE_BRIDGE
#include "portable.h"
#include <stdio.h>
+
+#include <ac/errno.h>
+#include <ac/signal.h>
+#include <ac/socket.h>
#include <ac/string.h>
#include <ac/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <errno.h>
-#include <signal.h>
+
#include "slap.h"
extern Operation *op_add();
extern pthread_mutex_t ops_mutex;
extern pthread_t listener_tid;
-#ifndef DECL_SYS_ERRLIST
-extern int sys_nerr;
-extern char *sys_errlist[];
-#endif
-
struct co_arg {
Connection *co_conn;
Operation *co_op;
do_bind( arg->co_conn, arg->co_op );
break;
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
case LDAP_REQ_UNBIND_30:
#endif
case LDAP_REQ_UNBIND:
do_add( arg->co_conn, arg->co_op );
break;
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
case LDAP_REQ_DELETE_30:
#endif
case LDAP_REQ_DELETE:
do_search( arg->co_conn, arg->co_op );
break;
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
case LDAP_REQ_ABANDON_30:
#endif
case LDAP_REQ_ABANDON:
return;
}
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
if ( conn->c_version == 30 ) {
(void) ber_skip_tag( ber, &len );
}
pthread_attr_init( &attr );
pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED );
-#ifndef THREAD_MIT_PTHREADS
+#if !defined(HAVE_PTHREADS_D4)
/* POSIX_THREADS or compatible
* This is a draft 10 or standard pthreads implementation
*/
if ( pthread_create( &arg->co_op->o_tid, &attr,
- (void *) connection_operation, (void *) arg ) != 0 ) {
+ connection_operation, (void *) arg ) != 0 ) {
Debug( LDAP_DEBUG_ANY, "pthread_create failed\n", 0, 0, 0 );
} else {
pthread_mutex_lock( &active_threads_mutex );
active_threads++;
pthread_mutex_unlock( &active_threads_mutex );
}
-#else /* !THREAD_MIT_PTHREAD */
+#else /* pthread draft4 */
/*
* This is a draft 4 or earlier pthreads implementation
*/
if ( pthread_create( &arg->co_op->o_tid, attr,
- (void *) connection_operation, (void *) arg ) != 0 ) {
+ connection_operation, (void *) arg ) != 0 ) {
Debug( LDAP_DEBUG_ANY, "pthread_create failed\n", 0, 0, 0 );
} else {
pthread_mutex_lock( &active_threads_mutex );
active_threads++;
pthread_mutex_unlock( &active_threads_mutex );
}
-#endif /* !THREAD_MIT_PTHREAD */
+#endif /* pthread draft4 */
pthread_attr_destroy( &attr );
}