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

Don't Allow the data dir to be set twice, since we don't have addititive...

Don't Allow the data dir to be set twice, since we don't have addititive directory behavior.  Fixes #2283.  close[t:2283]

git-svn-id: file:///svn/toku/tokudb@16826 c7de825b-a66e-492c-adef-691d508d4ae1
parent 05600769
......@@ -887,10 +887,9 @@ 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