From b803b49e5f0086502ebf181264d3ac90631e8371 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 12 Jan 2005 00:17:12 +0000 Subject: [PATCH] ITS#3421 flush and close logfile before releasing lock --- servers/slapd/lock.c | 3 ++- servers/slurpd/lock.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) 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 ); } -- 2.39.5