]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/os-local.c
Avoid locale specific ctype routines.
[openldap] / libraries / libldap / os-local.c
index 5d2a21f8f90a63ebcfb16769ff2123e96102ac52..5ad819eccf08d9df006f3a645e85cd24b337614a 100644 (file)
@@ -1,6 +1,6 @@
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 /*  Portions
@@ -13,7 +13,7 @@
 
 #include "portable.h"
 
-#ifdef LDAP_PF_LOCAL
+#ifdef LDAP_PF_UNIX
 
 #include <stdio.h>
 
@@ -33,6 +33,7 @@
 #endif /* HAVE_IO_H */
 
 #include "ldap-int.h"
+#include "ldap_defaults.h"
 
 /* int ldap_int_tblsize = 0; */
 
@@ -191,7 +192,7 @@ ldap_connect_to_path(LDAP *ld, Sockbuf *sb, const char *path, int async)
        }
 
        if ( path == NULL || path[0] == '\0' ) {
-               path = "/tmp/.ldap-sock";
+               path = LDAPI_SOCK;
        } else {
                if ( strlen(path) > (sizeof( server.sun_path ) - 1) ) {
                        ldap_pvt_set_errno( ENAMETOOLONG );
@@ -201,14 +202,14 @@ ldap_connect_to_path(LDAP *ld, Sockbuf *sb, const char *path, int async)
 
        oslocal_debug(ld, "ldap_connect_to_path: Trying %s\n", path, 0, 0);
 
-       memset( &server, 0, sizeof(server) );
+       memset( &server, '\0', sizeof(server) );
        server.sun_family = AF_UNIX;
        strcpy( server.sun_path, path );
 
        rc = ldap_pvt_connect(ld, s, &server, async);
 
        if (rc == 0) {
-               ber_pvt_sb_set_desc( sb, s );
+               ber_sockbuf_ctrl( sb, LBER_SB_OPT_SET_FD, (void *)&s );
        } else {
                ldap_pvt_close_socket(ld, s);
        }
@@ -216,4 +217,4 @@ ldap_connect_to_path(LDAP *ld, Sockbuf *sb, const char *path, int async)
 }
 #else
 static int dummy;
-#endif /* LDAP_PF_LOCAL */
+#endif /* LDAP_PF_UNIX */