]> git.sur5r.net Git - openldap/blobdiff - servers/slurpd/replog.c
Update copyright statements
[openldap] / servers / slurpd / replog.c
index 5c145a475bcdf57a988ae78bb934b1725bb25a08..73f1d32716cc051f437515805a6eb3022b56a3b0 100644 (file)
@@ -1,3 +1,8 @@
+/* $OpenLDAP$ */
+/*
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
 /*
  * Copyright (c) 1996 Regents of the University of Michigan.
  * All rights reserved.
  * replog.c - routines which read and write replication log files.
  */
 
-#define DISABLE_BRIDGE
 #include "portable.h"
 
-
-#include <errno.h>
 #include <stdio.h>
-#include <syslog.h>
+
+#include <ac/errno.h>
+#include <ac/param.h>
+#include <ac/string.h>
+#include <ac/syslog.h>
 #include <ac/time.h>
-#include <sys/types.h>
+#include <ac/unistd.h>
+
 #include <sys/stat.h>
-#include <sys/param.h>
+
 #include <fcntl.h>
-#include <unistd.h>
-#include <ac/string.h>
 
 #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 * ));
-
-
-#ifndef DECL_SYS_ERRLIST
-extern char *sys_errlist[];
-#endif
-
-/*
- * 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.
@@ -90,8 +73,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 );
@@ -102,8 +85,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 );
     }
 
@@ -122,7 +105,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 );
     }
 
@@ -138,12 +121,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 );