]> git.sur5r.net Git - openldap/commitdiff
Bare minimum changes to support BDB 4.0
authorHoward Chu <hyc@openldap.org>
Fri, 7 Dec 2001 05:05:00 +0000 (05:05 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 7 Dec 2001 05:05:00 +0000 (05:05 +0000)
servers/slapd/back-bdb/add.c
servers/slapd/back-bdb/back-bdb.h
servers/slapd/back-bdb/delete.c
servers/slapd/back-bdb/init.c
servers/slapd/back-bdb/modify.c
servers/slapd/back-bdb/modrdn.c

index 11e9527cf6871dc16a152316cc27b984cf739488..f9235b5009e47c5a2e996062f32e75843ecc4ce4 100644 (file)
@@ -299,7 +299,7 @@ return_results:
 
        if( rc == LDAP_SUCCESS && bdb->bi_txn_cp ) {
                ldap_pvt_thread_yield();
-               txn_checkpoint( bdb->bi_dbenv,
+               TXN_CHECKPOINT( bdb->bi_dbenv,
                        bdb->bi_txn_cp_kbyte, bdb->bi_txn_cp_min, 0 );
        }
 
index 97517e8b104cdb4512f79addad8783d0dd56e040..baa408a366f550c9923e9b8df7ca0b0d36187a3f 100644 (file)
@@ -110,6 +110,14 @@ struct bdb_op_info {
        int                     boi_err;
 };
 
+#if DB_VERSION_MAJOR < 4
+#define        TXN_CHECKPOINT(env, k, m, f)    txn_checkpoint(env, k, m, f)
+#define        LOCK_DETECT(env, f, t, a)       lock_detect(env, f, t, a)
+#else
+#define        TXN_CHECKPOINT(env, k, m, f)    (env)->txn_checkpoint(env, k, m, f)
+#define        LOCK_DETECT(env, f, t, a)       (env)->lock_detect(env, f, t, a)
+#endif
+
 LDAP_END_DECL
 
 #include "proto-bdb.h"
index 50e42069036065f5a7cf9b70b34de0c62e057e8b..6b034d40d7091f3a5309ade068c763b6b5039331 100644 (file)
@@ -316,7 +316,7 @@ return_results:
 
        if(rc == LDAP_SUCCESS && bdb->bi_txn_cp ) {
                ldap_pvt_thread_yield();
-               txn_checkpoint( bdb->bi_dbenv,
+               TXN_CHECKPOINT( bdb->bi_dbenv,
                        bdb->bi_txn_cp_kbyte, bdb->bi_txn_cp_min, 0 );
        }
 
index 6672c3029b0cf4f52b8a5435664a6f3d92ebce5f..d57b4a875686e3f382cc3c6f19706d496165cfea 100644 (file)
@@ -87,7 +87,7 @@ static void *lock_detect_task( void *arg )
                int rc;
                sleep( bdb->bi_lock_detect_seconds );
 
-               rc = lock_detect( bdb->bi_dbenv, 0,
+               rc = LOCK_DETECT( bdb->bi_dbenv, 0,
                        bdb->bi_lock_detect, NULL );
 
                if( rc != 0 ) {
@@ -311,7 +311,7 @@ bdb_db_destroy( BackendDB *be )
 
        /* force a checkpoint */
        if( bdb->bi_txn ) {
-               rc = txn_checkpoint( bdb->bi_dbenv, 0, 0, DB_FORCE );
+               rc = TXN_CHECKPOINT( bdb->bi_dbenv, 0, 0, DB_FORCE );
                if( rc != 0 ) {
                        Debug( LDAP_DEBUG_ANY,
                                "bdb_db_destroy: txn_checkpoint failed: %s (%d)\n",
index a72be960b4870c0af5cecfd9de3b6de0ea1ec2b7..77bbc3a8aeaf310cd5e2adc4df39094053d4bc12 100644 (file)
@@ -330,7 +330,7 @@ return_results:
 
        if( rc == LDAP_SUCCESS && bdb->bi_txn_cp ) {
                ldap_pvt_thread_yield();
-               txn_checkpoint( bdb->bi_dbenv,
+               TXN_CHECKPOINT( bdb->bi_dbenv,
                        bdb->bi_txn_cp_kbyte, bdb->bi_txn_cp_min, 0 );
        }
 
index 9f9d3be9e2041cfce895f16c1e22e590cc704038..454ec68375d379cbad432928f665ab8cf7af8766 100644 (file)
@@ -635,7 +635,7 @@ return_results:
 
        if( rc == LDAP_SUCCESS && bdb->bi_txn_cp ) {
                ldap_pvt_thread_yield();
-               txn_checkpoint( bdb->bi_dbenv,
+               TXN_CHECKPOINT( bdb->bi_dbenv,
                        bdb->bi_txn_cp_kbyte, bdb->bi_txn_cp_min, 0 );
        }