]> git.sur5r.net Git - openldap/blobdiff - servers/ldapd/util.c
Use -llber set_nonblock implementation.
[openldap] / servers / ldapd / util.c
index 27ecea9a5af394a1bc5187930c95b30cb4956bbf..84be225b9e69ccef54ae94a02c1c793b00640b1a 100644 (file)
  * is provided ``as is'' without express or implied warranty.
  */
 
+#include "portable.h"
+
 #include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/errno.h>
+
+#include <ac/ctype.h>
+#include <ac/errno.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+
 #include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
 #include <quipu/commonarg.h>
 #include <quipu/ds_error.h>
+
 #include "lber.h"
 #include "ldap.h"
 #include "common.h"
@@ -33,7 +38,7 @@
 void
 bprint( char *data, int len )
 {
-    static char        hexdig[] = "0123456789abcdef";
+    static const char  hexdig[] = "0123456789abcdef";
     char       out[ BPLEN ];
     int                i = 0;
 
@@ -48,8 +53,8 @@ bprint( char *data, int len )
            out[ i ] = ' ';
            out[ i+1 ] = *data;
        } else {
-           out[ i ] = hexdig[ ( *data & 0xf0 ) >> 4 ];
-           out[ i+1 ] = hexdig[ *data & 0x0f ];
+           out[ i ] = hexdig[ ( (unsigned char)*data & 0xf0 ) >> 4 ];
+           out[ i+1 ] = hexdig[ (unsigned char)*data & 0x0f ];
        }
        i += 2;
        len--;
@@ -65,7 +70,8 @@ bprint( char *data, int len )
     }
 }
 
-void charlist_free( char **cl )
+void
+charlist_free( char **cl )
 {
        int     i;
 
@@ -81,7 +87,6 @@ int
 get_ava( BerElement *ber, AVA *tava )
 {
        char                    *type, *value;
-       extern short            ldap_dn_syntax;
 
        Debug( LDAP_DEBUG_TRACE, "get_ava\n", 0, 0, 0 );
 
@@ -127,7 +132,6 @@ chase_referral(
        struct access_point     *ap;
        int                     rc, bound;
        struct conn             *save, *dup, *found;
-       struct PSAPaddr         *psap_cpy();
 
        Debug( LDAP_DEBUG_TRACE, "chase_referral\n", 0, 0, 0 );