-#ifdef HAVE_FLOCK
- while ( flock( fileno( *lfp ), LOCK_EX ) != 0 )
-#else
- while ( lockf( fileno( *lfp ), F_LOCK, 0 ) != 0 )
-#endif
- {
- ; /* NULL */
- }
+ ldap_lockf( fileno(*lfp) );
/* open the log file */
if ( (fp = fopen( fname, type )) == NULL ) {
Debug( LDAP_DEBUG_ANY,
"Error: could not open \"%s\"\n", fname, 0, 0 );
/* open the log file */
if ( (fp = fopen( fname, type )) == NULL ) {
Debug( LDAP_DEBUG_ANY,
"Error: could not open \"%s\"\n", fname, 0, 0 );
-#ifdef HAVE_FLOCK
- flock( fileno( *lfp ), LOCK_UN );
-#else
- lockf( fileno( *lfp ), F_ULOCK, 0 );
-#endif
+ ldap_unlockf( fileno(*lfp) );
-#ifdef HAVE_FLOCK
- flock( fileno( lfp ), LOCK_UN );
-#else
- lockf( fileno( lfp ), F_ULOCK, 0 );
-#endif
+ ldap_unlockf( fileno(lfp) );
- "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);
- "Error: relinquish_lock (%d): Error closing \"%s\"\n",
- getpid(), file, 0 );
+ "Error: relinquish_lock (%ld): Error closing \"%s\"\n",
+ (long) getpid(), file, 0 );