]> git.sur5r.net Git - openldap/commitdiff
ITS#3421 flush and close logfile before releasing lock
authorHoward Chu <hyc@openldap.org>
Wed, 12 Jan 2005 00:17:12 +0000 (00:17 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 12 Jan 2005 00:17:12 +0000 (00:17 +0000)
servers/slapd/lock.c
servers/slurpd/lock.c

index 9d42fc620e6d7eaf627d13a938f546221b81e3f1..1a8fc52a5786a9b9f092cc258867c4588d276d95 100644 (file)
@@ -74,9 +74,10 @@ lock_fopen( const char *fname, const char *type, FILE **lfp )
 int
 lock_fclose( FILE *fp, FILE *lfp )
 {
+       int rc = fclose( fp );
        /* unlock */
        ldap_unlockf( fileno(lfp) );
        fclose( lfp );
 
-       return( fclose( fp ) );
+       return( rc );
 }
index 9634f6b56596fee4d7ac26ca5f0e336713be124e..3ce58367d7ff9d4f201567875c1be80b7e32b272 100644 (file)
@@ -91,11 +91,13 @@ lock_fclose(
     FILE       *lfp
 )
 {
+       int rc = fclose( fp );
+
        /* unlock */
        ldap_unlockf( fileno(lfp) );
        fclose( lfp );
 
-       return( fclose( fp ) );
+       return( rc );
 }