From: Kurt Zeilenga Date: Sat, 5 Dec 1998 02:35:09 +0000 (+0000) Subject: Fix lock_fopen missing fclose bug... from rel_eng_1_1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4001a90c6aee9959f03a6bcca996096e502c015;p=thirdparty%2Fopenldap.git Fix lock_fopen missing fclose bug... from rel_eng_1_1 --- diff --git a/servers/slurpd/lock.c b/servers/slurpd/lock.c index 62aab06784..05500b0b94 100644 --- a/servers/slurpd/lock.c +++ b/servers/slurpd/lock.c @@ -26,8 +26,6 @@ #endif #include "../slapd/slap.h" - - FILE * lock_fopen( char *fname, @@ -65,6 +63,8 @@ lock_fopen( #else flock( fileno( *lfp ), LOCK_UN ); #endif + fclose( *lfp ); + *lfp = NULL; return( NULL ); } @@ -104,8 +104,8 @@ acquire_lock( { if (( *rfp = lock_fopen( file, "r+", lfp )) == NULL ) { Debug( LDAP_DEBUG_ANY, - "Error: acquire_lock(%d): Could not acquire lock on \"%s\"\n", - getpid(), file, 0); + "Error: acquire_lock(%ld): Could not acquire lock on \"%s\"\n", + (long) getpid(), file, 0); return( -1 ); } return( 0 ); @@ -126,8 +126,8 @@ relinquish_lock( { if ( lock_fclose( rfp, lfp ) == EOF ) { Debug( LDAP_DEBUG_ANY, - "Error: relinquish_lock (%d): Error closing \"%s\"\n", - getpid(), file, 0 ); + "Error: relinquish_lock (%ld): Error closing \"%s\"\n", + (long) getpid(), file, 0 ); return( -1 ); } return( 0 );