X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslurpd%2Freplog.c;h=d13ea4bb813c2f53704eda42cd644b2863576208;hb=fad62c5d1dea6fa56e740dd81ce025eaaaab1917;hp=5573215cc52e9c7b38aeb4d63296c0e52ca26ab8;hpb=5b62482fac5183d5a137f7e99b23012df16d4793;p=openldap diff --git a/servers/slurpd/replog.c b/servers/slurpd/replog.c index 5573215cc5..d13ea4bb81 100644 --- a/servers/slurpd/replog.c +++ b/servers/slurpd/replog.c @@ -1,3 +1,4 @@ +/* $OpenLDAP$ */ /* * Copyright (c) 1996 Regents of the University of Michigan. * All rights reserved. @@ -20,36 +21,19 @@ #include #include +#include #include #include #include #include #include -#include + #include #include "slurp.h" #include "globals.h" -/* - * Externs - */ -extern FILE *lock_fopen LDAP_P(( char *, char *, FILE ** )); -extern char *ch_malloc LDAP_P(( unsigned long )); - -/* - * Forward declarations - */ -int file_nonempty LDAP_P(( char * )); - - -/* - * Forward declarations - */ -static int duplicate_replog( char *, char * ); - - /* * Copy the replication log. Returns 0 on success, 1 if a temporary * error occurs, and -1 if a fatal error occurs. @@ -85,8 +69,8 @@ copy_replog( } if ( access( buf, W_OK ) < 0 ) { Debug( LDAP_DEBUG_ANY, - "Error: copy_replog (%d): Directory %s is not writable\n", - getpid(), buf, 0 ); + "Error: copy_replog (%ld): Directory %s is not writable\n", + (long) getpid(), buf, 0 ); return( -1 ); } strcpy( buf, dst ); @@ -97,8 +81,8 @@ copy_replog( } if ( access( buf, W_OK ) < 0 ) { Debug( LDAP_DEBUG_ANY, - "Error: copy_replog (%d): Directory %s is not writable\n", - getpid(), buf, 0 ); + "Error: copy_replog (%ld): Directory %s is not writable\n", + (long) getpid(), buf, 0 ); return( -1 ); } @@ -117,7 +101,7 @@ copy_replog( Debug( LDAP_DEBUG_ANY, "Error: copy_replog: Can't lock replog \"%s\" for write: %s\n", src, sys_errlist[ errno ], 0 ); - lock_fclose( rfp ); + lock_fclose( rfp, lfp ); return( 1 ); } @@ -133,12 +117,12 @@ copy_replog( truncate( src, (off_t) 0 ); } - if ( lock_fclose( rfp, lfp ) == EOF ) { + if ( lock_fclose( dfp, dlfp ) == EOF ) { Debug( LDAP_DEBUG_ANY, "Error: copy_replog: Error closing \"%s\"\n", src, 0, 0 ); } - if ( lock_fclose( dfp, dlfp ) == EOF ) { + if ( lock_fclose( rfp, lfp ) == EOF ) { Debug( LDAP_DEBUG_ANY, "Error: copy_replog: Error closing \"%s\"\n", src, 0, 0 );