From: Howard Chu Date: Wed, 12 Jan 2005 00:17:12 +0000 (+0000) Subject: ITS#3421 flush and close logfile before releasing lock X-Git-Tag: OPENLDAP_REL_ENG_2_3_BP~423 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b803b49e5f0086502ebf181264d3ac90631e8371;p=openldap ITS#3421 flush and close logfile before releasing lock --- diff --git a/servers/slapd/lock.c b/servers/slapd/lock.c index 9d42fc620e..1a8fc52a57 100644 --- a/servers/slapd/lock.c +++ b/servers/slapd/lock.c @@ -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 ); } diff --git a/servers/slurpd/lock.c b/servers/slurpd/lock.c index 9634f6b565..3ce58367d7 100644 --- a/servers/slurpd/lock.c +++ b/servers/slurpd/lock.c @@ -91,11 +91,13 @@ lock_fclose( FILE *lfp ) { + int rc = fclose( fp ); + /* unlock */ ldap_unlockf( fileno(lfp) ); fclose( lfp ); - return( fclose( fp ) ); + return( rc ); }