#include "portable.h"
#include <stdio.h>
-#include <stdlib.h>
+
+#include <ac/stdlib.h>
#include <ac/ctype.h>
#include <ac/signal.h>
#include "ldapconfig.h"
int debug;
+int ldap_syslog;
+int ldap_syslog_level;
int dosyslog;
int inetd;
int dtblsize;
myname = strdup( myname + 1 );
if ( debug ) {
- lber_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, &debug);
+ ber_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, &debug);
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, &debug);
}
do_queries( 0 );
- close( 0 );
+ tcp_close( 0 );
exit( 0 );
}
switch( pid = fork() ) {
case 0: /* child */
- close( s );
+ tcp_close( s );
do_queries( ns );
break;
break;
default: /* parent */
- close( ns );
+ tcp_close( ns );
if ( debug )
fprintf( stderr, "forked child %d\n", pid );
break;
if ( debug ) printf( "parent: catching child status\n" );
#ifdef HAVE_WAITPID
- while (waitpid ((pid_t) -1, NULL, WAIT_FLAGS) > 0)
+ while (waitpid ((pid_t) -1, (int *) NULL, WAIT_FLAGS) > 0)
; /* NULL */
#else
- while (wait3( &status, WAIT_FLAGS, 0 ) > 0 )
+ while (wait4( (pid_t) -1, &status, WAIT_FLAGS, 0 ) > 0 )
; /* NULL */
#endif
if ( debug ) {
fprintf( stderr, "got %d bytes\n", len );
#ifdef LDAP_DEBUG
- lber_bprint( buf, len );
+ ber_bprint( buf, len );
#endif
}
query = buf;
/* strip off leading white space */
- while ( isspace( *query )) {
+ while ( isspace( (unsigned char) *query )) {
++query;
--len;
}
}
if ( count == 1 ) {
- char *dn, **s, **oc;
- int rc;
+ char *dn, **oc;
e = ldap_first_entry( ld, res );
oc = ldap_get_values( ld, e, "objectClass" );