summaryrefslogtreecommitdiff
path: root/test/salvage
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/salvage
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/salvage')
-rw-r--r--test/salvage/salvage.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/test/salvage/salvage.c b/test/salvage/salvage.c
index c151853b90c..22a730a2bfc 100644
--- a/test/salvage/salvage.c
+++ b/test/salvage/salvage.c
@@ -56,6 +56,9 @@ static int verbose; /* -v flag */
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 *);
u_int ptype;
int ch, r;
@@ -66,19 +69,19 @@ main(int argc, char *argv[])
r = 0;
ptype = 0;
- while ((ch = getopt(argc, argv, "r:t:v")) != EOF)
+ while ((ch = __wt_getopt(progname, argc, argv, "r:t:v")) != EOF)
switch (ch) {
case 'r':
- r = atoi(optarg);
+ r = atoi(__wt_optarg);
if (r == 0)
return (usage());
break;
case 't':
- if (strcmp(optarg, "fix") == 0)
+ if (strcmp(__wt_optarg, "fix") == 0)
ptype = WT_PAGE_COL_FIX;
- else if (strcmp(optarg, "var") == 0)
+ else if (strcmp(__wt_optarg, "var") == 0)
ptype = WT_PAGE_COL_VAR;
- else if (strcmp(optarg, "row") == 0)
+ else if (strcmp(__wt_optarg, "row") == 0)
ptype = WT_PAGE_ROW_LEAF;
else
return (usage());
@@ -90,8 +93,8 @@ main(int argc, char *argv[])
default:
return (usage());
}
- argc -= optind;
- argv += optind;
+ argc -= __wt_optind;
+ argv += __wt_optind;
if (argc != 0)
return (usage());