summaryrefslogtreecommitdiff
path: root/test/salvage/salvage.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/salvage/salvage.c')
-rw-r--r--test/salvage/salvage.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/test/salvage/salvage.c b/test/salvage/salvage.c
index b8553bbd72d..83f9c6349bc 100644
--- a/test/salvage/salvage.c
+++ b/test/salvage/salvage.c
@@ -54,8 +54,6 @@ void run(int);
void t(int, u_int, int);
int usage(void);
-static const char *progname; /* Program name */
-
static FILE *res_fp; /* Results file */
static u_int page_type; /* File types */
static int value_unique; /* Values are unique */
@@ -70,10 +68,7 @@ main(int argc, char *argv[])
u_int ptype;
int ch, r;
- if ((progname = strrchr(argv[0], DIR_DELIM)) == NULL)
- progname = argv[0];
- else
- ++progname;
+ (void)testutil_set_progname(argv);
r = 0;
ptype = 0;
@@ -445,7 +440,8 @@ run(int r)
process();
- snprintf(buf, sizeof(buf), "cmp %s %s > /dev/null", DUMP, RSLT);
+ testutil_check(__wt_snprintf(
+ buf, sizeof(buf), "cmp %s %s > /dev/null", DUMP, RSLT));
if (system(buf)) {
fprintf(stderr,
"check failed, salvage results were incorrect\n");
@@ -490,28 +486,28 @@ build(int ikey, int ivalue, int cnt)
switch (page_type) {
case WT_PAGE_COL_FIX:
- (void)snprintf(config, sizeof(config),
+ testutil_check(__wt_snprintf(config, sizeof(config),
"key_format=r,value_format=7t,"
"allocation_size=%d,"
"internal_page_max=%d,internal_item_max=%d,"
"leaf_page_max=%d,leaf_item_max=%d",
- PSIZE, PSIZE, OSIZE, PSIZE, OSIZE);
+ PSIZE, PSIZE, OSIZE, PSIZE, OSIZE));
break;
case WT_PAGE_COL_VAR:
- (void)snprintf(config, sizeof(config),
+ testutil_check(__wt_snprintf(config, sizeof(config),
"key_format=r,"
"allocation_size=%d,"
"internal_page_max=%d,internal_item_max=%d,"
"leaf_page_max=%d,leaf_item_max=%d",
- PSIZE, PSIZE, OSIZE, PSIZE, OSIZE);
+ PSIZE, PSIZE, OSIZE, PSIZE, OSIZE));
break;
case WT_PAGE_ROW_LEAF:
- (void)snprintf(config, sizeof(config),
+ testutil_check(__wt_snprintf(config, sizeof(config),
"key_format=u,"
"allocation_size=%d,"
"internal_page_max=%d,internal_item_max=%d,"
"leaf_page_max=%d,leaf_item_max=%d",
- PSIZE, PSIZE, OSIZE, PSIZE, OSIZE);
+ PSIZE, PSIZE, OSIZE, PSIZE, OSIZE));
break;
default:
assert(0);
@@ -525,7 +521,8 @@ build(int ikey, int ivalue, int cnt)
case WT_PAGE_COL_VAR:
break;
case WT_PAGE_ROW_LEAF:
- snprintf(kbuf, sizeof(kbuf), "%010d KEY------", ikey);
+ testutil_check(__wt_snprintf(
+ kbuf, sizeof(kbuf), "%010d KEY------", ikey));
key.data = kbuf;
key.size = 20;
cursor->set_key(cursor, &key);
@@ -538,8 +535,8 @@ build(int ikey, int ivalue, int cnt)
break;
case WT_PAGE_COL_VAR:
case WT_PAGE_ROW_LEAF:
- snprintf(vbuf, sizeof(vbuf),
- "%010d VALUE----", value_unique ? ivalue : 37);
+ testutil_check(__wt_snprintf(vbuf, sizeof(vbuf),
+ "%010d VALUE----", value_unique ? ivalue : 37));
value.data = vbuf;
value.size = 20;
cursor->set_value(cursor, &value);
@@ -626,9 +623,9 @@ process(void)
/* Salvage. */
config[0] = '\0';
if (verbose)
- snprintf(config, sizeof(config),
+ testutil_check(__wt_snprintf(config, sizeof(config),
"error_prefix=\"%s\",verbose=[salvage,verify],",
- progname);
+ progname));
strcat(config, "log=(enabled=false),");
CHECK(wiredtiger_open(NULL, NULL, config, &conn) == 0);