summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2015-03-19 13:18:30 -0400
committerKeith Bostic <keith@wiredtiger.com>2015-03-19 13:18:30 -0400
commit032608ea967f1eb799164557315bbf9cf321da50 (patch)
treed8ee80d8e08b8eaa2d45bf26d45f96262ee12396 /src
parentf0138353697d8706bd1f26e83b9fff8f4e83af8d (diff)
downloadmongo-032608ea967f1eb799164557315bbf9cf321da50.tar.gz
Minor code shuffling, remove unused variables.
Diffstat (limited to 'src')
-rw-r--r--src/conn/conn_api.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/conn/conn_api.c b/src/conn/conn_api.c
index eba91d48898..912d4432539 100644
--- a/src/conn/conn_api.c
+++ b/src/conn/conn_api.c
@@ -1361,10 +1361,8 @@ __conn_write_base_config(WT_SESSION_IMPL *session, const char *cfg[])
WT_CONFIG_ITEM cval, k, v;
WT_DECL_RET;
int exist;
- char *path;
fp = NULL;
- path = NULL;
/*
* Discard any base configuration setup file left-over from previous
@@ -1373,16 +1371,18 @@ __conn_write_base_config(WT_SESSION_IMPL *session, const char *cfg[])
*/
WT_RET(__wt_remove_if_exists(session, WT_BASECONFIG_SET));
+ /* The base configuration file is optional, check the configuration. */
+ WT_RET(__wt_config_gets(session, cfg, "config_base", &cval));
+ if (!cval.val)
+ return (0);
+
/*
* We don't test separately if we're creating the database as we might
* have crashed between creating the "WiredTiger" file and creating the
* base configuration file. There's always a base configuration file,
* and we rename it into place, so it can only NOT exist if we crashed
- * before it was created.
+ * before it was created. If it already exists, we're done.
*/
- WT_RET(__wt_config_gets(session, cfg, "config_base", &cval));
- if (!cval.val)
- return (0);
WT_RET(__wt_exist(session, WT_BASECONFIG, &exist));
if (exist)
return (0);
@@ -1453,9 +1453,6 @@ err: WT_TRET(__wt_fp_close(session, &fp));
/* Discard any damaged temporary file, not required but cleaner. */
WT_TRET(__wt_remove_if_exists(session, WT_BASECONFIG_SET));
- if (path != NULL)
- __wt_free(session, path);
-
return (ret);
}