From: Kurt Zeilenga Date: Mon, 18 Sep 2000 21:35:08 +0000 (+0000) Subject: Add errpfx and errcall X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1952 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c1fdf4587c1d7a3e12ed8e479d74a2fa8f75b0f5;p=openldap Add errpfx and errcall --- diff --git a/servers/slapd/back-bdb/back-bdb.h b/servers/slapd/back-bdb/back-bdb.h index 286ce53ed1..d10ecdcda6 100644 --- a/servers/slapd/back-bdb/back-bdb.h +++ b/servers/slapd/back-bdb/back-bdb.h @@ -38,4 +38,6 @@ struct bdb_dbinfo { LDAP_END_DECL +#include "proto-bdb.h" + #endif /* _BACK_BDB_H_ */ diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index c19bbdca99..6555cfc11d 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -185,9 +185,11 @@ bdb_back_db_open( flags |= DB_INIT_MPOOL; #endif + bdi->bdi_dbenv->set_errpfx( bdi->bdi_dbenv, be->be_suffix[0] ); + bdi->bdi_dbenv->set_errcall( bdi->bdi_dbenv, bdb_errcall ); + rc = bdi->bdi_dbenv->set_tmp_dir( bdi->bdi_dbenv, bdi->bdi_db_tmp_dir ); - if( rc != 0 ) { Debug( LDAP_DEBUG_ANY, "bdb_back_db_open: set_tmp_dir(%s) failed: %s (%d)\n", @@ -197,7 +199,6 @@ bdb_back_db_open( rc = bdi->bdi_dbenv->set_lg_dir( bdi->bdi_dbenv, bdi->bdi_db_lg_dir ); - if( rc != 0 ) { Debug( LDAP_DEBUG_ANY, "bdb_back_db_open: set_lg_dir(%s) failed: %s (%d)\n", @@ -207,7 +208,6 @@ bdb_back_db_open( rc = bdi->bdi_dbenv->set_data_dir( bdi->bdi_dbenv, bdi->bdi_db_data_dir ); - if( rc != 0 ) { Debug( LDAP_DEBUG_ANY, "bdb_back_db_open: set_data_dir(%s) failed: %s (%d)\n", @@ -219,7 +219,6 @@ bdb_back_db_open( bdi->bdi_dbenv_home, flags | bdi->bdi_dbenv_xflags, bdi->bdi_dbenv_mode ); - if( rc != 0 ) { Debug( LDAP_DEBUG_ANY, "bdb_back_db_open: db_open(%s) failed: %s (%d)\n", diff --git a/servers/slapd/back-bdb/proto-bdb.h b/servers/slapd/back-bdb/proto-bdb.h new file mode 100644 index 0000000000..a5434711cf --- /dev/null +++ b/servers/slapd/back-bdb/proto-bdb.h @@ -0,0 +1,19 @@ +/* $OpenLDAP$ */ +/* + * Copyright 2000 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ + +#ifndef _PROTO_BDB_H +#define _PROTO_BDB_H + +LDAP_BEGIN_DECL + +/* + * error.c + */ +void bdb_errcall( const char *pfx, char * msg ); + +LDAP_END_DECL + +#endif /* _PROTO_BDB_H */