]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/lock.c
fix Release configuration
[openldap] / servers / slapd / lock.c
index 391dd4639a6595036a18becc37b98294754aeb9e..fe3a850abd779fe1bf5539babb96368829db2f2d 100644 (file)
@@ -12,7 +12,9 @@
 #ifdef HAVE_SYS_FILE_H
 #include <sys/file.h>
 #endif
+#ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
+#endif
 #include "slap.h"
 
 FILE *
@@ -30,14 +32,12 @@ lock_fopen( char *fname, char *type, FILE **lfp )
        }
 
        /* acquire the lock */
-       while ( ldap_lockf( *lfp ) != 0 ) {
-               ;       /* NULL */
-       }
+       ldap_lockf( fileno(*lfp) );
 
        /* open the log file */
        if ( (fp = fopen( fname, type )) == NULL ) {
                Debug( LDAP_DEBUG_ANY, "could not open \"%s\"\n", fname, 0, 0 );
-               ldap_unlockf( *lfp );
+               ldap_unlockf( fileno(*lfp) );
                fclose( *lfp );
                *lfp = NULL;
                return( NULL );
@@ -50,7 +50,7 @@ int
 lock_fclose( FILE *fp, FILE *lfp )
 {
        /* unlock */
-       ldap_unlockf( lfp );
+       ldap_unlockf( fileno(lfp) );
        fclose( lfp );
 
        return( fclose( fp ) );