From: Howard Chu Date: Sat, 16 Apr 2005 01:24:00 +0000 (+0000) Subject: ITS#3660 fix BDB verbose calls X-Git-Tag: OPENLDAP_AC_BP~884 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=41d37a335e34aa3e08c490c47a55a941ed22bd05;p=openldap ITS#3660 fix BDB verbose calls --- diff --git a/servers/slapd/back-bdb/error.c b/servers/slapd/back-bdb/error.c index ea1db3215e..9a9885e3af 100644 --- a/servers/slapd/back-bdb/error.c +++ b/servers/slapd/back-bdb/error.c @@ -35,6 +35,17 @@ void bdb_errcall( const DB_ENV *env, const char *pfx, const char * msg ) Debug( LDAP_DEBUG_ANY, "bdb(%s): %s\n", pfx, msg, 0 ); } +#if DB_VERSION_FULL >= 0x04030000 +void bdb_msgcall( const DB_ENV *env, const char *msg ) +{ +#ifdef HAVE_EBCDIC + if ( msg[0] > 0x7f ) + __etoa( msg ); +#endif + Debug( LDAP_DEBUG_TRACE, "bdb: %s\n", msg, 0, 0 ); +} +#endif + #ifdef HAVE_EBCDIC #undef db_strerror diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index b0ec7c65fa..fb2af4d1db 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -115,7 +115,11 @@ bdb_do_recovery( BackendDB *be ) re_dbenv->set_errpfx( re_dbenv, be->be_suffix[0].bv_val ); re_dbenv->set_errcall( re_dbenv, bdb_errcall ); (void)re_dbenv->set_verbose(re_dbenv, DB_VERB_RECOVERY, 1); +#if DB_VERSION_FULL < 0x04030000 (void)re_dbenv->set_verbose(re_dbenv, DB_VERB_CHKPOINT, 1); +#else + re_dbenv->set_msgcall( re_dbenv, bdb_msgcall ); +#endif flags = DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN | DB_USE_ENVIRON | DB_RECOVER; diff --git a/servers/slapd/back-bdb/proto-bdb.h b/servers/slapd/back-bdb/proto-bdb.h index b63b9f3d95..31d289c260 100644 --- a/servers/slapd/back-bdb/proto-bdb.h +++ b/servers/slapd/back-bdb/proto-bdb.h @@ -146,7 +146,9 @@ int bdb_fix_dn( Entry *e, int checkit ); #if DB_VERSION_FULL < 0x04030000 void bdb_errcall( const char *pfx, char * msg ); #else +#define bdb_msgcall BDB_SYMBOL(msgcall) void bdb_errcall( const DB_ENV *env, const char *pfx, const char * msg ); +void bdb_msgcall( const DB_ENV *env, const char * msg ); #endif #ifdef HAVE_EBCDIC