Commit 477b0463 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 a12ca96f
...@@ -450,15 +450,22 @@ static int toku_env_open(DB_ENV * env, const char *home, u_int32_t flags, int mo ...@@ -450,15 +450,22 @@ 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.
{ {
struct stat buf; BOOL made_new_home = FALSE;
r = stat(home, &buf); char* new_home = NULL;
if (r!=0) { struct stat buf;
return toku_ydb_do_error(env, errno, "Error from stat(\"%s\",...)\n", home); if (home[strlen(home)-1] == '\\') {
} new_home = toku_malloc(strlen(home));
} memcpy(new_home, home, strlen(home));
new_home[strlen(home) - 1] = 0;
if (!(flags & DB_PRIVATE)) { made_new_home = TRUE;
return toku_ydb_do_error(env, EINVAL, "TokuDB requires DB_PRIVATE when opening an env\n"); }
r = stat(made_new_home? new_home : home, &buf);
if (made_new_home) {
toku_free(new_home);
}
if (r!=0) {
return toku_ydb_do_error(env, errno, "Error from stat(\"%s\",...)\n", home);
}
} }
unused_flags &= ~DB_PRIVATE; unused_flags &= ~DB_PRIVATE;
......
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