]> git.sur5r.net Git - openldap/commitdiff
Add errpfx and errcall
authorKurt Zeilenga <kurt@openldap.org>
Mon, 18 Sep 2000 21:35:08 +0000 (21:35 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 18 Sep 2000 21:35:08 +0000 (21:35 +0000)
servers/slapd/back-bdb/back-bdb.h
servers/slapd/back-bdb/init.c
servers/slapd/back-bdb/proto-bdb.h [new file with mode: 0644]

index 286ce53ed1aefcecd1a5c8920cf4840b0ab9099b..d10ecdcda60b3c16896833c8a264b29e4907ad83 100644 (file)
@@ -38,4 +38,6 @@ struct bdb_dbinfo {
 
 LDAP_END_DECL
 
+#include "proto-bdb.h"
+
 #endif /* _BACK_BDB_H_ */
index c19bbdca99bb56b833d18051cdcc1163da48c983..6555cfc11d1aac6026e7505ab8e89c419f3b8697 100644 (file)
@@ -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 (file)
index 0000000..a543471
--- /dev/null
@@ -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 */