summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2012-05-07 20:28:43 +0000
committerKeith Bostic <keith@wiredtiger.com>2012-05-07 20:28:43 +0000
commitf899a311517ede23bbfe7963746ade32bcf68af7 (patch)
tree88ce37f0cbdca6bff56aa1a410745561f6240798 /ext
parentc4dfc3f4d26eccfea8619670e718164a7550d042 (diff)
downloadmongo-f899a311517ede23bbfe7963746ade32bcf68af7.tar.gz
Rework WT_EVENT_HANDLERs.
All 3 event handlers can now return an error (we ignore the return in the __wt_err/__wt_errx functions, presumably those aren't being called unless we're already returning an error). If a handler itself fails, we report the failure using first the application- The big result of this change is the WT_VERBOSE macro family can now all return errors. Get rid of WT_VERBOSE, and replace it with WT_VERBOSE_ERR (jump to err: on error) and WT_VERBOSE_RET (return value on error), plus WT_VERBOSE_VOID (ignore any error) in a few places. Remove WT_VERBOSE_CALL, and inline the test in the few places that used it. This change required lots of code shuffling, changing void functions to return errors, and other kinds of cleanups. Change the WiredTiger error-printf extension function to return an error. Again, I would anticipate callers to the function would ignore the return (presumably, they're calling the error printf function before returning an error), but there's no reason to believe that's the case, or that the inability to inject an error message into the system isn't fatal in a different way than the error being reported. While I was in the area, simplify the interface the error-printf extension uses, rather than export __wt_eventv in all its 7-argument glory. I also wrote some documentation for all of the extension functions. I shuffled the code in block-manager open/close to always unload any snapshot that had been loaded (partially, or fully), it's better than the caller guessing how far we got in the open process before failing. Rename __wt_msgv to be __wt_vmsg (match the print(3)-style API names).
Diffstat (limited to 'ext')
-rw-r--r--ext/compressors/bzip2_compress/bzip2_compress.c2
-rw-r--r--ext/compressors/snappy_compress/snappy_compress.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/ext/compressors/bzip2_compress/bzip2_compress.c b/ext/compressors/bzip2_compress/bzip2_compress.c
index 7d31e97ec09..bc67e0f23ee 100644
--- a/ext/compressors/bzip2_compress/bzip2_compress.c
+++ b/ext/compressors/bzip2_compress/bzip2_compress.c
@@ -120,7 +120,7 @@ bzip2_error(WT_SESSION *session, const char *call, int bzret)
break;
}
- wiredtiger_err_printf(
+ (void)wiredtiger_err_printf(
session, "bzip2 error: %s: %s: %d", call, msg, bzret);
return (WT_ERROR);
}
diff --git a/ext/compressors/snappy_compress/snappy_compress.c b/ext/compressors/snappy_compress/snappy_compress.c
index 77ac9d9c10e..c11a8e740af 100644
--- a/ext/compressors/snappy_compress/snappy_compress.c
+++ b/ext/compressors/snappy_compress/snappy_compress.c
@@ -86,7 +86,7 @@ wt_snappy_error(WT_SESSION *session, const char *call, snappy_status snret)
break;
}
- wiredtiger_err_printf(
+ (void)wiredtiger_err_printf(
session, "snappy error: %s: %s: %d", call, msg, snret);
return (WT_ERROR);
}
@@ -147,7 +147,7 @@ wt_snappy_decompress(WT_COMPRESSOR *compressor, WT_SESSION *session,
/* retrieve the saved length */
snaplen = *(size_t *)src;
if (snaplen + sizeof(size_t) > src_len) {
- wiredtiger_err_printf(
+ (void)wiredtiger_err_printf(
session,
"wt_snappy_decompress: stored size exceeds buffer size");
return (WT_ERROR);