From 6df4889f4361543978e9f01dce48468898dbe653 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 17 Nov 2001 14:39:10 +0000 Subject: [PATCH] minor cleanup --- servers/slapd/back-ldbm/attr.c | 4 ++-- servers/slapd/back-ldbm/dbcache.c | 1 + servers/slapd/back-ldbm/dn2id.c | 1 - servers/slapd/back-ldbm/group.c | 1 - servers/slapd/back-ldbm/id2entry.c | 1 - servers/slapd/back-ldbm/idl.c | 9 ++++----- servers/slapd/back-ldbm/index.c | 1 - servers/slapd/back-ldbm/init.c | 3 --- servers/slapd/back-ldbm/passwd.c | 4 ++-- 9 files changed, 9 insertions(+), 16 deletions(-) diff --git a/servers/slapd/back-ldbm/attr.c b/servers/slapd/back-ldbm/attr.c index b9cbd7e2e5..b4cbf2d1e7 100644 --- a/servers/slapd/back-ldbm/attr.c +++ b/servers/slapd/back-ldbm/attr.c @@ -183,10 +183,10 @@ attr_index_config( #ifdef NEW_LOGGING LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "attr_index_config: index %s 0x%04x\n", + "attr_index_config: index %s 0x%04lx\n", ad->ad_cname.bv_val, mask )); #else - Debug( LDAP_DEBUG_CONFIG, "index %s 0x%04x\n", + Debug( LDAP_DEBUG_CONFIG, "index %s 0x%04lx\n", ad->ad_cname.bv_val, mask, 0 ); #endif diff --git a/servers/slapd/back-ldbm/dbcache.c b/servers/slapd/back-ldbm/dbcache.c index c5f92b8761..a90512127b 100644 --- a/servers/slapd/back-ldbm/dbcache.c +++ b/servers/slapd/back-ldbm/dbcache.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include "slap.h" diff --git a/servers/slapd/back-ldbm/dn2id.c b/servers/slapd/back-ldbm/dn2id.c index 55c016b85c..1375ac5b5e 100644 --- a/servers/slapd/back-ldbm/dn2id.c +++ b/servers/slapd/back-ldbm/dn2id.c @@ -26,7 +26,6 @@ dn2id_add( int rc, flags; DBCache *db; Datum key, data; - struct ldbminfo *li = (struct ldbminfo *) be->be_private; #ifdef NEW_LOGGING LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, diff --git a/servers/slapd/back-ldbm/group.c b/servers/slapd/back-ldbm/group.c index 2de91fd5e8..476ce38a59 100644 --- a/servers/slapd/back-ldbm/group.c +++ b/servers/slapd/back-ldbm/group.c @@ -39,7 +39,6 @@ ldbm_back_group( Attribute *attr; struct berval bv; - AttributeDescription *ad_objectClass = slap_schema.si_ad_objectClass; const char *group_oc_name = NULL; const char *group_at_name = group_at->ad_cname.bv_val; diff --git a/servers/slapd/back-ldbm/id2entry.c b/servers/slapd/back-ldbm/id2entry.c index 69a5ceb3da..ffeacca293 100644 --- a/servers/slapd/back-ldbm/id2entry.c +++ b/servers/slapd/back-ldbm/id2entry.c @@ -22,7 +22,6 @@ int id2entry_add( Backend *be, Entry *e ) { - struct ldbminfo *li = (struct ldbminfo *) be->be_private; DBCache *db; Datum key, data; int len, rc, flags; diff --git a/servers/slapd/back-ldbm/idl.c b/servers/slapd/back-ldbm/idl.c index beae715f0f..8bd1256ad6 100644 --- a/servers/slapd/back-ldbm/idl.c +++ b/servers/slapd/back-ldbm/idl.c @@ -279,7 +279,6 @@ idl_store( { int rc, flags; Datum data; - struct ldbminfo *li = (struct ldbminfo *) be->be_private; #ifdef LDBM_DEBUG_IDL idl_check(idl); @@ -292,14 +291,14 @@ idl_store( data.dptr = (char *) idl; data.dsize = (ID_BLOCK_IDS_OFFSET + ID_BLOCK_NMAXN(idl)) * sizeof(ID); + flags = LDBM_REPLACE; + rc = ldbm_cache_store( db, key, data, flags ); + #ifdef LDBM_DEBUG Statslog( LDAP_DEBUG_STATS, "<= idl_store(): rc=%d\n", rc, 0, 0, 0, 0 ); #endif - flags = LDBM_REPLACE; - rc = ldbm_cache_store( db, key, data, flags ); - /* Debug( LDAP_DEBUG_TRACE, "<= idl_store %d\n", rc, 0, 0 ); */ return( rc ); } @@ -458,7 +457,7 @@ idl_insert_key( ID id ) { - int i, j, first, rc; + int i, j, first, rc = 0; ID_BLOCK *idl, *tmp, *tmp2, *tmp3; Datum k2; diff --git a/servers/slapd/back-ldbm/index.c b/servers/slapd/back-ldbm/index.c index c937178135..f64afa95a8 100644 --- a/servers/slapd/back-ldbm/index.c +++ b/servers/slapd/back-ldbm/index.c @@ -235,7 +235,6 @@ static int index_at_values( { slap_mask_t mask = 0; slap_mask_t tmpmask = 0; - int lindex = 0; if( type->sat_sup ) { /* recurse */ diff --git a/servers/slapd/back-ldbm/init.c b/servers/slapd/back-ldbm/init.c index f369e31bd4..bba57e967d 100644 --- a/servers/slapd/back-ldbm/init.c +++ b/servers/slapd/back-ldbm/init.c @@ -103,9 +103,6 @@ ldbm_back_open( { int rc; - struct ldbm_backend_info *lbi - = (struct ldbm_backend_info *) bi->bi_private; - /* initialize the underlying database system */ rc = ldbm_initialize( NULL ); return rc; diff --git a/servers/slapd/back-ldbm/passwd.c b/servers/slapd/back-ldbm/passwd.c index 41b3046459..4e3df088e3 100644 --- a/servers/slapd/back-ldbm/passwd.c +++ b/servers/slapd/back-ldbm/passwd.c @@ -131,7 +131,6 @@ ldbm_back_exop_passwd( Modifications ml; struct berval *vals[2]; char textbuf[SLAP_TEXT_BUFLEN]; /* non-returnable */ - size_t textlen; vals[0] = hash; vals[1] = NULL; @@ -142,7 +141,8 @@ ldbm_back_exop_passwd( ml.sml_next = NULL; rc = ldbm_modify_internal( be, - conn, op, op->o_ndn, &ml, e, text, textbuf, textlen ); + conn, op, op->o_ndn, &ml, e, text, textbuf, + sizeof( textbuf ) ); /* FIXME: ldbm_modify_internal may set *tex = textbuf, * which is BAD */ -- 2.39.5