Commit 6793b58e authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

addresses #1032

report change from 1032 branch

git-svn-id: file:///svn/toku/tokudb.1032b@7865 c7de825b-a66e-492c-adef-691d508d4ae1
parent 0b450025
...@@ -450,16 +450,23 @@ static int toku_env_open(DB_ENV * env, const char *home, u_int32_t flags, int mo ...@@ -450,16 +450,23 @@ static int toku_env_open(DB_ENV * env, const char *home, u_int32_t flags, int mo
// Verify that the home exists. // Verify that the home exists.
{ {
BOOL made_new_home = FALSE;
char* new_home = NULL;
struct stat buf; struct stat buf;
r = stat(home, &buf); if (home[strlen(home)-1] == '\\') {
new_home = toku_malloc(strlen(home));
memcpy(new_home, home, strlen(home));
new_home[strlen(home) - 1] = 0;
made_new_home = TRUE;
}
r = stat(made_new_home? new_home : home, &buf);
if (made_new_home) {
toku_free(new_home);
}
if (r!=0) { if (r!=0) {
return toku_ydb_do_error(env, errno, "Error from stat(\"%s\",...)\n", home); return toku_ydb_do_error(env, errno, "Error from stat(\"%s\",...)\n", home);
} }
} }
if (!(flags & DB_PRIVATE)) {
return toku_ydb_do_error(env, EINVAL, "TokuDB requires DB_PRIVATE when opening an env\n");
}
unused_flags &= ~DB_PRIVATE; unused_flags &= ~DB_PRIVATE;
if (env->i->dir) if (env->i->dir)
......
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