diff options
author | Keith Bostic <keith@wiredtiger.com> | 2013-12-07 09:12:35 -0500 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2013-12-07 09:12:35 -0500 |
commit | 929f33fc5bf498667a331c626ee9c11ae086ed9e (patch) | |
tree | e2f62119a0d9dc0f94b4ec37040a9646ca62bd2a | |
parent | 45abf34a7d31325ac14c138b59fbc043c4042344 (diff) | |
download | mongo-929f33fc5bf498667a331c626ee9c11ae086ed9e.tar.gz |
Internal WT programs are using WT_UNUSED everywhere, test/bloom was the
last hold-out. While in the area, noticed test/bloom doesn't need
signal or event handlers, fix function signatures, and there was an
extraneous newline written by the usage function.
-rw-r--r-- | test/bloom/test_bloom.c | 58 |
1 files changed, 11 insertions, 47 deletions
diff --git a/test/bloom/test_bloom.c b/test/bloom/test_bloom.c index bbf2592be65..b4b24319ad4 100644 --- a/test/bloom/test_bloom.c +++ b/test/bloom/test_bloom.c @@ -51,20 +51,11 @@ GLOBAL g; static int cleanup(void); void die(int e, const char *fmt, ...); -static int handle_message(WT_EVENT_HANDLER *, WT_SESSION *, const char *); -static void onint(int signo); static int populate_entries(void); static int run(void); static int setup(void); static void usage(void); -static WT_EVENT_HANDLER event_handler = { - NULL, - handle_message, - NULL, - NULL /* Close handler. */ -}; - int main(int argc, char *argv[]) { @@ -108,9 +99,6 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - /* Clean up on signal. */ - (void)signal(SIGINT, onint); - setup(); run(); cleanup(); @@ -118,7 +106,8 @@ main(int argc, char *argv[]) return (EXIT_SUCCESS); } -int setup(void) +int +setup(void) { WT_CONNECTION *conn; WT_SESSION *session; @@ -140,7 +129,7 @@ int setup(void) "create,error_prefix=\"%s\",cache_size=%" PRIu32 "MB,%s", g.progname, g.c_cache, g.config_open == NULL ? "" : g.config_open); - if ((ret = wiredtiger_open(NULL, &event_handler, config, &conn)) != 0) + if ((ret = wiredtiger_open(NULL, NULL, config, &conn)) != 0) die(ret, "wiredtiger_open"); if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0) @@ -154,14 +143,15 @@ int setup(void) return (0); } -int run(void) +int +run(void) { WT_BLOOM *bloomp; WT_ITEM item; WT_SESSION_IMPL *sess; - const char *uri = "file:my_bloom.bf"; - int ret; uint32_t fp, i; + int ret; + const char *uri = "file:my_bloom.bf"; /* Use the internal session handle to access private APIs. */ sess = (WT_SESSION_IMPL *)g.wt_session; @@ -222,7 +212,8 @@ int run(void) return (0); } -int cleanup(void) +int +cleanup(void) { uint32_t i; @@ -238,7 +229,8 @@ int cleanup(void) * Create and keep all the strings used to populate the bloom filter, so that * we can do validation with the same set of entries. */ -static int populate_entries(void) +static int +populate_entries(void) { uint32_t i, j; uint8_t **entries; @@ -261,16 +253,6 @@ static int populate_entries(void) return (0); } -static int -handle_message(WT_EVENT_HANDLER *handler, - WT_SESSION *session, const char *message) -{ - (void)handler; - (void)session; - - return (printf("%s\n", message) < 0 ? -1 : 0); -} - /* * die -- * Report an error and quit. @@ -294,22 +276,6 @@ die(int e, const char *fmt, ...) } /* - * onint -- - * Interrupt signal handler. - */ -static void -onint(int signo) -{ - (void)signo; - - /* Remove the run's files except for __rand. - (void)system("rm -rf WiredTiger WiredTiger.* __[a-qs-z]* __run");*/ - - fprintf(stderr, "\n"); - exit(EXIT_FAILURE); -} - -/* * usage -- * Display usage statement and exit failure. */ @@ -324,7 +290,5 @@ usage(void) "\t-o number of operations to perform\n" "\t-s random seed for run\n"); - fprintf(stderr, "\n"); - exit(EXIT_FAILURE); } |