From: Howard Chu Date: Sat, 16 Oct 2004 22:10:32 +0000 (+0000) Subject: BDB 4.3 compatibility X-Git-Tag: OPENLDAP_REL_ENG_2_3_0ALPHA~425 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e6a12272cc918ce537aa4e3912048e23e7bd2d5f;p=openldap BDB 4.3 compatibility --- diff --git a/servers/slapd/back-bdb/error.c b/servers/slapd/back-bdb/error.c index cbb457929a..d324ec5f46 100644 --- a/servers/slapd/back-bdb/error.c +++ b/servers/slapd/back-bdb/error.c @@ -22,7 +22,11 @@ #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 ) diff --git a/servers/slapd/back-bdb/idl.c b/servers/slapd/back-bdb/idl.c index 1e1453822d..505cfd4cfa 100644 --- a/servers/slapd/back-bdb/idl.c +++ b/servers/slapd/back-bdb/idl.c @@ -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; diff --git a/servers/slapd/back-bdb/proto-bdb.h b/servers/slapd/back-bdb/proto-bdb.h index 6d1c507d83..13bc550a54 100644 --- a/servers/slapd/back-bdb/proto-bdb.h +++ b/servers/slapd/back-bdb/proto-bdb.h @@ -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)