From 9f5f75c7b044a751ba3fee290790ae047f360be3 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 16 Mar 2004 21:55:45 +0000 Subject: [PATCH] init 'oi' also when the backend already has overlays... --- servers/slapd/backover.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/servers/slapd/backover.c b/servers/slapd/backover.c index 21ced8051a..d97225ac47 100644 --- a/servers/slapd/backover.c +++ b/servers/slapd/backover.c @@ -267,15 +267,27 @@ overlay_register( return 0; } +slap_overinst * +overlay_next( + slap_overinst *on +) +{ + if ( on == NULL ) { + return overlays; + } + + return on->on_next; +} + static const char overtype[] = "over"; /* add an overlay to a particular backend. */ int overlay_config( BackendDB *be, const char *ov ) { - slap_overinst *on, *on2, *prev; - slap_overinfo *oi; - BackendInfo *bi; + slap_overinst *on = NULL, *on2 = NULL, *prev = NULL; + slap_overinfo *oi = NULL; + BackendInfo *bi = NULL; for ( on = overlays; on; on=on->on_next ) { if (!strcmp( ov, on->on_bi.bi_type ) ) @@ -316,13 +328,15 @@ overlay_config( BackendDB *be, const char *ov ) bi->bi_extended = over_op_extended; be->bd_info = bi; + + } else { + oi = (slap_overinfo *) be->bd_info; } #if 0 /* Walk to the end of the list of overlays, add the new * one onto the end */ - oi = (slap_overinfo *) be->bd_info; for ( prev=NULL, on2 = oi->oi_list; on2; prev=on2, on2=on2->on_next ); on2 = ch_calloc( 1, sizeof(slap_overinst) ); if ( !prev ) { -- 2.39.5