Commit 64f079d4 authored by Barry Perlman's avatar Barry Perlman Committed by Yoni Fogel

[t:3187] Make assert code more robust.


git-svn-id: file:///svn/toku/tokudb@27209 c7de825b-a66e-492c-adef-691d508d4ae1
parent 8605fe10
......@@ -740,6 +740,8 @@ toku_env_open(DB_ENV * env, const char *home, u_int32_t flags, int mode) {
BOOL newenv; // true iff creating a new environment
u_int32_t unused_flags=flags;
most_recent_env = NULL;
if (env_opened(env)) {
r = toku_ydb_do_error(env, EINVAL, "The environment is already open\n");
goto cleanup;
......@@ -2135,7 +2137,7 @@ toku_maybe_get_engine_status_text (char * buff, int buffsize) {
static void
toku_maybe_set_env_panic(int code, char * msg) {
DB_ENV * env = most_recent_env;
if (env) {
if (env && env->i) {
if (env->i->is_panicked == 0) {
env->i->is_panicked = code;
env->i->panic_string = toku_strdup(msg);
......
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