]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Fix lock_fopen missing fclose bug... from rel_eng_1_1
authorKurt Zeilenga <kurt@openldap.org>
Sat, 5 Dec 1998 02:35:09 +0000 (02:35 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sat, 5 Dec 1998 02:35:09 +0000 (02:35 +0000)
servers/slurpd/lock.c

index 62aab06784b37f5acd99621aa00da0c789b69a70..05500b0b94982214fef33c9debb66574d60940e3 100644 (file)
@@ -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 );