From: Howard Chu Date: Tue, 25 Sep 2012 11:37:29 +0000 (-0700) Subject: More for envflags X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d426cafacacf3d45c734c1f65e6e438c5ce605a3;p=openldap More for envflags If trying to alter a non-resettable flag, just close/reopen the env. --- diff --git a/servers/slapd/back-mdb/config.c b/servers/slapd/back-mdb/config.c index 8e7ce671d3..28c06b2a4f 100644 --- a/servers/slapd/back-mdb/config.c +++ b/servers/slapd/back-mdb/config.c @@ -379,8 +379,11 @@ mdb_cf_gen( ConfigArgs *c ) if ( mdb->mi_dbenv_flags & mdb_envflags[i].mask ) { /* not all flags are runtime resettable */ rc = mdb_env_set_flags( mdb->mi_dbenv, mdb_envflags[i].mask, 0 ); - if ( rc ) - break; + if ( rc ) { + mdb->mi_flags |= MDB_RE_OPEN; + c->cleanup = mdb_cf_cleanup; + rc = 0; + } mdb->mi_dbenv_flags ^= mdb_envflags[i].mask; } } @@ -388,8 +391,15 @@ mdb_cf_gen( ConfigArgs *c ) int i = verb_to_mask( c->line, mdb_envflags ); if ( mdb_envflags[i].mask & mdb->mi_dbenv_flags ) { rc = mdb_env_set_flags( mdb->mi_dbenv, mdb_envflags[i].mask, 0 ); - if ( !rc ) - mdb->mi_dbenv_flags ^= mdb_envflags[i].mask; + if ( rc ) { + mdb->mi_flags |= MDB_RE_OPEN; + c->cleanup = mdb_cf_cleanup; + rc = 0; + } + mdb->mi_dbenv_flags ^= mdb_envflags[i].mask; + } else { + /* unknown keyword */ + rc = 1; } } break; @@ -583,10 +593,15 @@ mdb_cf_gen( ConfigArgs *c ) rc = mdb_env_set_flags( mdb->mi_dbenv, mdb_envflags[j].mask, 1 ); else rc = 0; - if ( rc ) - break; - else - mdb->mi_dbenv_flags |= mdb_envflags[i].mask; + if ( rc ) { + mdb->mi_flags |= MDB_RE_OPEN; + c->cleanup = mdb_cf_cleanup; + rc = 0; + } + mdb->mi_dbenv_flags |= mdb_envflags[i].mask; + } else { + /* unknown keyword */ + rc = 1; } } }