summaryrefslogtreecommitdiff
path: root/test/utility/parse_opts.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/utility/parse_opts.c')
-rw-r--r--test/utility/parse_opts.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/test/utility/parse_opts.c b/test/utility/parse_opts.c
index 08aeafa9617..74a1c021d5d 100644
--- a/test/utility/parse_opts.c
+++ b/test/utility/parse_opts.c
@@ -27,10 +27,6 @@
*/
#include "test_util.h"
-extern int __wt_opterr; /* if error message should be printed */
-extern int __wt_optind; /* index into parent argv vector */
-extern int __wt_optopt; /* character checked for validity */
-extern int __wt_optreset; /* reset getopt */
extern char *__wt_optarg; /* argument associated with option */
/*
@@ -59,7 +55,7 @@ testutil_parse_opts(int argc, char * const *argv, TEST_OPTS *opts)
opts->n_append_threads = (uint64_t)atoll(__wt_optarg);
break;
case 'h': /* Home directory */
- opts->home = __wt_optarg;
+ opts->home = dstrdup(__wt_optarg);
break;
case 'n': /* Number of records */
opts->nrecords = (uint64_t)atoll(__wt_optarg);
@@ -116,12 +112,14 @@ testutil_parse_opts(int argc, char * const *argv, TEST_OPTS *opts)
}
/*
- * Setup the home directory. It needs to be unique for every test
- * or the auto make parallel tester gets upset.
+ * Setup the home directory if not explicitly specified. It needs to be
+ * unique for every test or the auto make parallel tester gets upset.
*/
- len = strlen("WT_TEST.") + strlen(opts->progname) + 10;
- opts->home = dmalloc(len);
- snprintf(opts->home, len, "WT_TEST.%s", opts->progname);
+ if (opts->home == NULL) {
+ len = strlen("WT_TEST.") + strlen(opts->progname) + 10;
+ opts->home = dmalloc(len);
+ snprintf(opts->home, len, "WT_TEST.%s", opts->progname);
+ }
/* Setup the default URI string */
len = strlen("table:") + strlen(opts->progname) + 10;