summaryrefslogtreecommitdiff
path: root/test/checkpoint/test_checkpoint.c
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2014-10-10 08:52:55 -0400
committerKeith Bostic <keith@wiredtiger.com>2014-10-10 08:52:55 -0400
commitee28ec9dda6f88866bf1ac0269d3c823ed2ae116 (patch)
tree2b3456c0dfd836ce0ed0e6e6347a7bf871c0e07a /test/checkpoint/test_checkpoint.c
parentd206f7ba6f58c6ad648af6cd693ce03f8d6fe161 (diff)
downloadmongo-ee28ec9dda6f88866bf1ac0269d3c823ed2ae116.tar.gz
Move the utilities/util_getopt.c implementation of getopt(3) into the
WiredTiger library, and convert all of the utilities and test programs to use it.
Diffstat (limited to 'test/checkpoint/test_checkpoint.c')
-rw-r--r--test/checkpoint/test_checkpoint.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/test/checkpoint/test_checkpoint.c b/test/checkpoint/test_checkpoint.c
index 7b26766b9ca..70f5e52185e 100644
--- a/test/checkpoint/test_checkpoint.c
+++ b/test/checkpoint/test_checkpoint.c
@@ -41,6 +41,9 @@ static int wt_shutdown(void);
int
main(int argc, char *argv[])
{
+ extern char *__wt_optarg;
+ extern int __wt_optind;
+ extern int __wt_getopt(const char *, int, char * const *, const char *);
table_type ttype;
int ch, cnt, ret, runs;
const char *config_open, *home;
@@ -61,35 +64,36 @@ main(int argc, char *argv[])
g.nworkers = 1;
runs = 1;
- while ((ch = getopt(argc, argv, "c:C:h:k:l:n:r:t:T:W:")) != EOF)
+ while ((ch = __wt_getopt(
+ g.progname, argc, argv, "c:C:h:k:l:n:r:t:T:W:")) != EOF)
switch (ch) {
case 'c':
- g.checkpoint_name = optarg;
+ g.checkpoint_name = __wt_optarg;
break;
case 'C': /* wiredtiger_open config */
- config_open = optarg;
+ config_open = __wt_optarg;
break;
case 'h': /* wiredtiger_open config */
- home = optarg;
+ home = __wt_optarg;
break;
case 'k': /* rows */
- g.nkeys = (u_int)atoi(optarg);
+ g.nkeys = (u_int)atoi(__wt_optarg);
break;
case 'l': /* log */
- if ((g.logfp = fopen(optarg, "w")) == NULL) {
+ if ((g.logfp = fopen(__wt_optarg, "w")) == NULL) {
fprintf(stderr,
- "%s: %s\n", optarg, strerror(errno));
+ "%s: %s\n", __wt_optarg, strerror(errno));
return (EXIT_FAILURE);
}
break;
case 'n': /* operations */
- g.nops = (u_int)atoi(optarg);
+ g.nops = (u_int)atoi(__wt_optarg);
break;
case 'r': /* runs */
- runs = atoi(optarg);
+ runs = atoi(__wt_optarg);
break;
case 't':
- switch (optarg[0]) {
+ switch (__wt_optarg[0]) {
case 'c':
ttype = COL;
break;
@@ -107,16 +111,16 @@ main(int argc, char *argv[])
}
break;
case 'T':
- g.ntables = atoi(optarg);
+ g.ntables = atoi(__wt_optarg);
break;
case 'W':
- g.nworkers = atoi(optarg);
+ g.nworkers = atoi(__wt_optarg);
break;
default:
return (usage());
}
- argc -= optind;
+ argc -= __wt_optind;
if (argc != 0)
return (usage());