X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fos-local.c;h=5ad819eccf08d9df006f3a645e85cd24b337614a;hb=49d73e12a720cfe052a335d82e67994ff261d21c;hp=5d2a21f8f90a63ebcfb16769ff2123e96102ac52;hpb=9b4e3b2234b0d347c90dc09b1638e8e93497dae1;p=openldap diff --git a/libraries/libldap/os-local.c b/libraries/libldap/os-local.c index 5d2a21f8f9..5ad819eccf 100644 --- a/libraries/libldap/os-local.c +++ b/libraries/libldap/os-local.c @@ -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 @@ -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 */