From: Kurt Zeilenga Date: Thu, 4 Feb 1999 17:28:49 +0000 (+0000) Subject: Backout startup/initialization changes in preparation for new X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~641 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fc44d42c5389a4220904753ebb2adb90908064c6;p=openldap Backout startup/initialization changes in preparation for new frontend->backend interface. --- diff --git a/servers/slapd/back-ldbm/Makefile.in b/servers/slapd/back-ldbm/Makefile.in index 45e8836447..985149e9d9 100644 --- a/servers/slapd/back-ldbm/Makefile.in +++ b/servers/slapd/back-ldbm/Makefile.in @@ -2,11 +2,11 @@ XSRCS = version.c SRCS = idl.c add.c search.c cache.c dbcache.c dn2id.c id2entry.c \ index.c id2children.c nextid.c abandon.c compare.c group.c \ modify.c modrdn.c delete.c init.c config.c bind.c attr.c \ - filterindex.c unbind.c kerberos.c close.c alias.c startup.c + filterindex.c unbind.c kerberos.c close.c alias.c OBJS = idl.o add.o search.o cache.o dbcache.o dn2id.o id2entry.o \ index.o id2children.o nextid.o abandon.o compare.o group.o \ modify.o modrdn.o delete.o init.o config.o bind.o attr.o \ - filterindex.o unbind.o kerberos.o close.o alias.o startup.o + filterindex.o unbind.o kerberos.o close.o alias.o LDAP_INCDIR= ../../../include LDAP_LIBDIR= ../../../libraries diff --git a/servers/slapd/back-ldbm/back-ldbm.h b/servers/slapd/back-ldbm/back-ldbm.h index 1244bb1f93..e0816acd48 100644 --- a/servers/slapd/back-ldbm/back-ldbm.h +++ b/servers/slapd/back-ldbm/back-ldbm.h @@ -88,10 +88,6 @@ struct dbcache { long dbc_blksize; char *dbc_name; LDBM dbc_db; - -#ifdef HAVE_BERKELEY_DB2 - struct dbcache *dbc_next; -#endif }; /* for the cache of attribute information (which are indexed, etc.) */ @@ -138,11 +134,6 @@ struct ldbminfo { struct dbcache li_dbcache[MAXDBCACHE]; ldap_pvt_thread_mutex_t li_dbcache_mutex; ldap_pvt_thread_cond_t li_dbcache_cv; - -#ifdef HAVE_BERKELEY_DB2 - /* Berkeley DB2 Environment */ - DB_ENV li_db_env; -#endif }; #include "proto-back-ldbm.h" diff --git a/servers/slapd/back-ldbm/dbcache.c b/servers/slapd/back-ldbm/dbcache.c index 4638efa309..5e3549ff34 100644 --- a/servers/slapd/back-ldbm/dbcache.c +++ b/servers/slapd/back-ldbm/dbcache.c @@ -34,7 +34,7 @@ ldbm_cache_open( LDBM db; struct stat st; - sprintf( buf, "%s%s%s%s", li->li_directory, DEFAULT_DIRSEP, name, suffix ); + sprintf( buf, "%s/%s%s", li->li_directory, name, suffix ); Debug( LDAP_DEBUG_TRACE, "=> ldbm_cache_open( \"%s\", %d, %o )\n", buf, flags, li->li_mode ); @@ -91,13 +91,8 @@ ldbm_cache_open( li->li_dbcache[i].dbc_name = NULL; } -#ifdef HAVE_BERKELEY_DB2 - if ( (li->li_dbcache[i].dbc_db = ldbm_open_env( buf, flags, li->li_mode, - li->li_dbcachesize, &li->li_db_env )) == NULL ) { -#else if ( (li->li_dbcache[i].dbc_db = ldbm_open( buf, flags, li->li_mode, li->li_dbcachesize )) == NULL ) { -#endif Debug( LDAP_DEBUG_TRACE, "<= ldbm_cache_open NULL \"%s\" errno %d reason \"%s\")\n", buf, errno, errno > -1 && errno < sys_nerr ? diff --git a/servers/slapd/back-ldbm/init.c b/servers/slapd/back-ldbm/init.c index 5a7acc3617..f0ae9fb777 100644 --- a/servers/slapd/back-ldbm/init.c +++ b/servers/slapd/back-ldbm/init.c @@ -19,13 +19,17 @@ ldbm_back_init( char *argv[ 4 ]; int i; + /* initialize the underlying database system */ + ldbm_initialize(); + /* allocate backend-specific stuff */ li = (struct ldbminfo *) ch_calloc( 1, sizeof(struct ldbminfo) ); /* arrange to read nextid later (on first request for it) */ li->li_nextid = NOID; -#if SLAPD_NEXTID_CHUNCK > 1 - li->li_nextid_wrote = NOID + +#if SLAPD_NEXTID_CHUNK > 1 + li->li_nextid_wrote = NOID; #endif /* default cache size */ diff --git a/servers/slapd/back-ldbm/proto-back-ldbm.h b/servers/slapd/back-ldbm/proto-back-ldbm.h index 5650befa2b..5b0ecd852f 100644 --- a/servers/slapd/back-ldbm/proto-back-ldbm.h +++ b/servers/slapd/back-ldbm/proto-back-ldbm.h @@ -121,14 +121,6 @@ int index_add_values LDAP_P(( Backend *be, char *type, struct berval **vals, ID /* krbv4_ldap_auth LDAP_P(( Backend *be, struct berval *cred, AUTH_DAT *ad )); */ #endif -/* - * startup.c - */ - -void ldbm_back_startup LDAP_P(( Backend *be )); -void ldbm_back_shutdown LDAP_P(( Backend *be )); -void ldbm_db_errcall LDAP_P(( const char *prefix, char *message )); - /* * nextid.c */