Commit 44b2c612 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

Allow the data dir to be set twice. Fixes #2283. close[t:2283]

git-svn-id: file:///svn/toku/tokudb@16824 c7de825b-a66e-492c-adef-691d508d4ae1
parent 9c2b243e
......@@ -887,9 +887,10 @@ static int toku_env_set_data_dir(DB_ENV * env, const char *dir) {
if (env_opened(env) || !dir) {
r = toku_ydb_do_error(env, EINVAL, "You cannot set the data dir after opening the env\n");
}
else if (env->i->data_dir)
r = toku_ydb_do_error(env, EINVAL, "You cannot set the data dir more than once.\n");
else {
if (env->i->data_dir) {
toku_free(env->i->data_dir);
}
env->i->data_dir = toku_strdup(dir);
if (env->i->data_dir==NULL) {
assert(errno == ENOMEM);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment