]> git.sur5r.net Git - openldap/blobdiff - servers/slurpd/rq.c
fix small issues with dynacl and ACI in general
[openldap] / servers / slurpd / rq.c
index 37098c9f3649e23aa29a1a943c8d63350d922039..4649118000a0075b299be3757eb82c8537cbf223 100644 (file)
@@ -1,10 +1,18 @@
 /* $OpenLDAP$ */
-/*
- * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1998-2005 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
  */
-/*
- * Copyright (c) 1996 Regents of the University of Michigan.
+/* Portions Copyright (c) 1996 Regents of the University of Michigan.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms are permitted
  * software without specific prior written permission. This software
  * is provided ``as is'' without express or implied warranty.
  */
+/* ACKNOWLEDGEMENTS:
+ * This work was originally developed by the University of Michigan
+ * (as part of U-MICH LDAP).
+ */
 
 /*
  * rq.c - routines used to manage the queue of replication entries.
@@ -55,7 +67,6 @@
 #include "slurp.h"
 #include "globals.h"
 
-
 /*
  * Lock the replication queue.
  */
@@ -133,13 +144,8 @@ Rq_delhead(
     }
 
     if ( savedhead->re_getrefcnt( savedhead ) != 0 ) {
-#ifdef NEW_LOGGING
-       LDAP_LOG (( "rq", LDAP_LEVEL_WARNING, "Rq_delhead: "
-               "Warning: attempt to delete when refcnt != 0\n" ));
-#else
        Debug( LDAP_DEBUG_ANY, "Warning: attempt to delete when refcnt != 0\n",
                0, 0, 0 );
-#endif
        return( -1 );
     }
 
@@ -222,11 +228,7 @@ Rq_gc(
 )
 {
     if ( rq == NULL ) {
-#ifdef NEW_LOGGING
-       LDAP_LOG (( "rq", LDAP_LEVEL_DETAIL1, "Rq_gc: rq is NULL!\n" ));
-#else
        Debug( LDAP_DEBUG_ANY, "Rq_gc: rq is NULL!\n", 0, 0, 0 );
-#endif
        return;
     }
     rq->rq_lock( rq ); 
@@ -254,42 +256,23 @@ Rq_dump(
     int                tmpfd;
 
     if ( rq == NULL ) {
-#ifdef NEW_LOGGING
-       LDAP_LOG (( "rq", LDAP_LEVEL_ARGS, "Rq_dump: rq is NULL!\n" ));
-#else
        Debug( LDAP_DEBUG_ANY, "Rq_dump: rq is NULL!\n", 0, 0, 0 );
-#endif
        return;
     }
 
     if (unlink(SLURPD_DUMPFILE) == -1 && errno != ENOENT) {
-#ifdef NEW_LOGGING
-       LDAP_LOG (( "rq", LDAP_LEVEL_ERR, "Rq_dump: "
-               "\"%s\" exists, cannot unlink\n", SLURPD_DUMPFILE ));
-#else
        Debug( LDAP_DEBUG_ANY, "Rq_dump: \"%s\" exists, and cannot unlink\n",
                SLURPD_DUMPFILE, 0, 0 );
-#endif
        return;
     }
     if (( tmpfd = open(SLURPD_DUMPFILE, O_CREAT|O_RDWR|O_EXCL, 0600)) == -1) {
-#ifdef NEW_LOGGING
-       LDAP_LOG (( "rq", LDAP_LEVEL_ERR, "Rq_dump: "
-               "cannot open \"%s\" for write\n", SLURPD_DUMPFILE ));
-#else
        Debug( LDAP_DEBUG_ANY, "Rq_dump: cannot open \"%s\" for write\n",
                SLURPD_DUMPFILE, 0, 0 );
-#endif
        return;
     }
     if (( fp = fdopen( tmpfd, "w" )) == NULL ) {
-#ifdef NEW_LOGGING
-       LDAP_LOG (( "rq", LDAP_LEVEL_ERR, "Rq_dump: "
-               "cannot fdopen \"%s\" for write\n", SLURPD_DUMPFILE ));
-#else
        Debug( LDAP_DEBUG_ANY, "Rq_dump: cannot fdopen \"%s\" for write\n",
                SLURPD_DUMPFILE, 0, 0 );
-#endif
        return;
     }
 
@@ -321,13 +304,8 @@ Rq_write(
        return -1;
     }
 
-#ifdef NEW_LOGGING
-       LDAP_LOG (( "rq", LDAP_LEVEL_ENTRY, "Rq_write: "
-               "re-write on-disk replication log\n" ));
-#else
     Debug( LDAP_DEBUG_ARGS, "re-write on-disk replication log\n",
            0, 0, 0 );
-#endif
 #ifndef SEEK_SET
 #define SEEK_SET 0
 #endif
@@ -345,13 +323,8 @@ Rq_write(
     sglob->srpos = ftell( fp );        /* update replog file position */
     /* and truncate to correct len */
     if ( ftruncate( fileno( fp ), sglob->srpos ) < 0 ) {
-#ifdef NEW_LOGGING
-       LDAP_LOG (( "rq", LDAP_LEVEL_ERR, "Rq_write: "
-               "Error truncating replication log: %s\n", sys_errlist[ errno ] ));
-#else
        Debug( LDAP_DEBUG_ANY, "Error truncating replication log: %s\n",
                sys_errlist[ errno ], 0, 0 );
-#endif
     }
     rq->rq_ndel = 0;   /* reset count of deleted re's */
     time( &now );