]> git.sur5r.net Git - openldap/commitdiff
BDB 4.3 compatibility
authorHoward Chu <hyc@openldap.org>
Sat, 16 Oct 2004 22:10:32 +0000 (22:10 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 16 Oct 2004 22:10:32 +0000 (22:10 +0000)
servers/slapd/back-bdb/error.c
servers/slapd/back-bdb/idl.c
servers/slapd/back-bdb/proto-bdb.h

index cbb457929a0eee08b9f29b3664185572aee67217..d324ec5f4672eb60652a583bd1dabe157cc3f646 100644 (file)
 #include "slap.h"
 #include "back-bdb.h"
 
+#if DB_VERSION_FULL < 0x04030000
 void bdb_errcall( const char *pfx, char * msg )
+#else
+void bdb_errcall( DB_ENV *env, const char *pfx, const char * msg )
+#endif
 {
 #ifdef HAVE_EBCDIC
        if ( msg[0] > 0x7f )
index 1e1453822d155ccd76540d20fcdae4c23c24ec00..505cfd4cfa5497b11f2b84b2f692dce0be8a912d 100644 (file)
@@ -724,14 +724,9 @@ bdb_idl_insert_key(
                                }
                        }
                        if ( id < lo || id > hi ) {
-                               /* Delete the current lo/hi */
-                               rc = cursor->c_del( cursor, 0 );
-                               if ( rc != 0 ) {
-                                       err = "c_del";
-                                       goto fail;
-                               }
+                               /* Replace the current lo/hi */
                                data.data = &id;
-                               rc = cursor->c_put( cursor, key, &data, DB_KEYFIRST );
+                               rc = cursor->c_put( cursor, key, &data, DB_CURRENT );
                                if ( rc != 0 ) {
                                        err = "c_put lo/hi";
                                        goto fail;
index 6d1c507d8332e993a6e5658fb8567b314a4058c1..13bc550a54df7e6cafd20188515c1d2354924559 100644 (file)
@@ -139,7 +139,11 @@ int bdb_fix_dn( Entry *e, int checkit );
  */
 #define bdb_errcall                                    BDB_SYMBOL(errcall)
 
+#if DB_VERSION_FULL < 0x04030000
 void bdb_errcall( const char *pfx, char * msg );
+#else
+void bdb_errcall( DB_ENV *env, const char *pfx, const char * msg );
+#endif
 
 #ifdef HAVE_EBCDIC
 #define ebcdic_dberror                         BDB_SYMBOL(ebcdic_dberror)