]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/open.c
Add O_EXCL
[openldap] / libraries / libldap / open.c
index 244dde7317c1008b69688591543c6c012d070444..8030790a942a9d3d5d26b768553376227b3c4740 100644 (file)
@@ -23,6 +23,7 @@
 #include <ac/time.h>
 
 #include "ldap-int.h"
+#include "ldap_log.h"
 
 int ldap_open_defconn( LDAP *ld )
 {
@@ -54,8 +55,12 @@ ldap_open( LDAP_CONST char *host, int port )
        int rc;
        LDAP            *ld;
 
+#ifdef NEW_LOGGING
+       LDAP_LOG ( CONNECTION, ARGS, "ldap_open(%s, %d)\n", host, port, 0 );
+#else
        Debug( LDAP_DEBUG_TRACE, "ldap_open(%s, %d)\n",
                host, port, 0 );
+#endif
 
        ld = ldap_init( host, port );
        if ( ld == NULL ) {
@@ -69,8 +74,13 @@ ldap_open( LDAP_CONST char *host, int port )
                ld = NULL;
        }
 
+#ifdef NEW_LOGGING
+       LDAP_LOG ( CONNECTION, RESULTS, "ldap_open: %s\n",
+               ld == NULL ? "succeeded" : "failed", 0, 0 );
+#else
        Debug( LDAP_DEBUG_TRACE, "ldap_open: %s\n",
                ld == NULL ? "succeeded" : "failed", 0, 0 );
+#endif
 
        return ld;
 }
@@ -96,7 +106,11 @@ ldap_create( LDAP **ldp )
                        return LDAP_LOCAL_ERROR;
        }
 
+#ifdef NEW_LOGGING
+       LDAP_LOG ( CONNECTION, ENTRY, "ldap_create\n", 0, 0, 0 );
+#else
        Debug( LDAP_DEBUG_TRACE, "ldap_create\n", 0, 0, 0 );
+#endif
 
        if ( (ld = (LDAP *) LDAP_CALLOC( 1, sizeof(LDAP) )) == NULL ) {
                return( LDAP_NO_MEMORY );
@@ -225,7 +239,11 @@ ldap_int_open_connection(
        int port, proto;
        long addr;
 
+#ifdef NEW_LOGGING
+       LDAP_LOG ( CONNECTION, ENTRY, "ldap_int_open_connection\n", 0, 0, 0 );
+#else
        Debug( LDAP_DEBUG_TRACE, "ldap_int_open_connection\n", 0, 0, 0 );
+#endif
 
        switch ( proto = ldap_pvt_url_scheme2proto( srv->lud_scheme ) ) {
                case LDAP_PROTO_TCP: