]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/lock.c
More changes to let BDB build without LDBM.
[openldap] / servers / slapd / lock.c
index e9f5fda164383f1948fd6279e831ea324d2b8c59..856c6c7fb418f9f0ed0aa446112f148073e35f46 100644 (file)
@@ -1,7 +1,7 @@
 /* lock.c - routines to open and apply an advisory lock to a file */
 /* $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
  */
 
@@ -17,9 +17,7 @@
 #ifdef HAVE_SYS_FILE_H
 #include <sys/file.h>
 #endif
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
+
 #include "slap.h"
 
 FILE *
@@ -32,7 +30,13 @@ lock_fopen( const char *fname, const char *type, FILE **lfp )
        strcpy( buf, fname );
        strcat( buf, ".lock" );
        if ( (*lfp = fopen( buf, "w" )) == NULL ) {
+#ifdef NEW_LOGGING
+               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
+                          "lock_fopen: could not open lock file \"%s\".\n", buf ));
+#else
                Debug( LDAP_DEBUG_ANY, "could not open \"%s\"\n", buf, 0, 0 );
+#endif
+
                return( NULL );
        }
 
@@ -41,7 +45,13 @@ lock_fopen( const char *fname, const char *type, FILE **lfp )
 
        /* open the log file */
        if ( (fp = fopen( fname, type )) == NULL ) {
+#ifdef NEW_LOGGING
+               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
+                          "lock_fopen: could not open log file \"%s\".\n", buf ));
+#else
                Debug( LDAP_DEBUG_ANY, "could not open \"%s\"\n", fname, 0, 0 );
+#endif
+
                ldap_unlockf( fileno(*lfp) );
                fclose( *lfp );
                *lfp = NULL;