]> 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 f19277017e9359b0c0cab9982db2fc7687698973..4649118000a0075b299be3757eb82c8537cbf223 100644 (file)
@@ -1,10 +1,18 @@
 /* $OpenLDAP$ */
-/*
- * Copyright 1998-2003 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.
@@ -132,13 +144,8 @@ Rq_delhead(
     }
 
     if ( savedhead->re_getrefcnt( savedhead ) != 0 ) {
-#ifdef NEW_LOGGING
-       LDAP_LOG ( SLURPD, WARNING, "Rq_delhead: "
-               "Warning: attempt to delete when refcnt != 0\n", 0, 0, 0 );
-#else
        Debug( LDAP_DEBUG_ANY, "Warning: attempt to delete when refcnt != 0\n",
                0, 0, 0 );
-#endif
        return( -1 );
     }
 
@@ -221,11 +228,7 @@ Rq_gc(
 )
 {
     if ( rq == NULL ) {
-#ifdef NEW_LOGGING
-       LDAP_LOG ( SLURPD, DETAIL1, "Rq_gc: rq is NULL!\n", 0, 0, 0 );
-#else
        Debug( LDAP_DEBUG_ANY, "Rq_gc: rq is NULL!\n", 0, 0, 0 );
-#endif
        return;
     }
     rq->rq_lock( rq ); 
@@ -253,42 +256,23 @@ Rq_dump(
     int                tmpfd;
 
     if ( rq == NULL ) {
-#ifdef NEW_LOGGING
-       LDAP_LOG ( SLURPD, ARGS, "Rq_dump: rq is NULL!\n", 0, 0, 0 );
-#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 ( SLURPD, ERR, "Rq_dump: "
-               "\"%s\" exists, cannot unlink\n", SLURPD_DUMPFILE, 0, 0 );
-#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 ( SLURPD, ERR, "Rq_dump: "
-               "cannot open \"%s\" for write\n", SLURPD_DUMPFILE, 0, 0 );
-#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 ( SLURPD, ERR, "Rq_dump: "
-               "cannot fdopen \"%s\" for write\n", SLURPD_DUMPFILE, 0, 0 );
-#else
        Debug( LDAP_DEBUG_ANY, "Rq_dump: cannot fdopen \"%s\" for write\n",
                SLURPD_DUMPFILE, 0, 0 );
-#endif
        return;
     }
 
@@ -320,13 +304,8 @@ Rq_write(
        return -1;
     }
 
-#ifdef NEW_LOGGING
-       LDAP_LOG ( SLURPD, ENTRY, "Rq_write: "
-               "re-write on-disk replication log\n", 0, 0, 0 );
-#else
     Debug( LDAP_DEBUG_ARGS, "re-write on-disk replication log\n",
            0, 0, 0 );
-#endif
 #ifndef SEEK_SET
 #define SEEK_SET 0
 #endif
@@ -344,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 ( SLURPD, ERR, "Rq_write: "
-               "Error truncating replication log: %s\n", sys_errlist[ errno ], 0, 0 );
-#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 );