summaryrefslogtreecommitdiff
path: root/src/meta
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2012-11-28 18:17:52 +0000
committerKeith Bostic <keith@wiredtiger.com>2012-11-28 18:17:52 +0000
commit4736de42d3724057c8e460227a7b7c1109196c27 (patch)
tree11cbb13a6a5f9d6ab43d2354999dc05be7051709 /src/meta
parent466a84d857f87ec920de5a0647210db203ff1b2e (diff)
downloadmongo-4736de42d3724057c8e460227a7b7c1109196c27.tar.gz
Fix a bug I just introduced: I can't use WT_NOTFOUND to flag an existing
entry lacking a checkpoint, it has to be a side-effect.
Diffstat (limited to 'src/meta')
-rw-r--r--src/meta/meta_ckpt.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/meta/meta_ckpt.c b/src/meta/meta_ckpt.c
index f41a3cfba94..7fc62650591 100644
--- a/src/meta/meta_ckpt.c
+++ b/src/meta/meta_ckpt.c
@@ -45,9 +45,13 @@ __wt_meta_checkpoint(WT_SESSION_IMPL *session,
* Clear any stack-allocated structure.
*/
WT_CLEAR(*ckpt);
- if (checkpoint == NULL)
- WT_ERR(__ckpt_last(session, config, ckpt));
- else
+ if (checkpoint == NULL) {
+ if ((ret = __ckpt_last(session, config, ckpt)) == WT_NOTFOUND) {
+ ret = 0;
+ ckpt->addr.data = ckpt->raw.data = NULL;
+ ckpt->addr.size = ckpt->raw.size = 0;
+ }
+ } else
WT_ERR(__ckpt_named(session, checkpoint, config, ckpt));
err: __wt_free(session, config);