]> git.sur5r.net Git - openldap/commitdiff
ITS#3703 skip checkpoint on close if ReadOnly mode
authorHoward Chu <hyc@openldap.org>
Wed, 4 May 2005 06:41:39 +0000 (06:41 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 4 May 2005 06:41:39 +0000 (06:41 +0000)
servers/slapd/back-bdb/init.c

index 21c4985d8f770d5b5f53fe687d0c96b2638ab6c4..84ecfe3087203857fead0b3a9cc48c054431d9a1 100644 (file)
@@ -582,8 +582,10 @@ bdb_db_close( BackendDB *be )
 
        /* close db environment */
        if( bdb->bi_dbenv ) {
-               /* force a checkpoint */
-               if ( !( slapMode & SLAP_TOOL_QUICK )) {
+               /* force a checkpoint, but not if we were ReadOnly,
+                * and not in Quick mode since there are no transactions there.
+                */
+               if ( !( slapMode & ( SLAP_TOOL_QUICK|SLAP_TOOL_READONLY ))) {
                        rc = TXN_CHECKPOINT( bdb->bi_dbenv, 0, 0, DB_FORCE );
                        if( rc != 0 ) {
                                Debug( LDAP_DEBUG_ANY,