diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2017-05-26 21:29:52 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2017-05-26 21:29:52 (GMT) |
commit | 343b53d64f4e8ecd2fbab5c356099918e55d8238 (patch) | |
tree | a2f28f5ae74c08ad37aee92bf2f1762393444d3c /test/use_common.c | |
parent | 479f326a267ca5ffacc2012f33674c66cf2907d8 (diff) | |
parent | 9e75f7eeee5d52d35a8dcbffb6c1c18e1966d12b (diff) | |
download | hdf5-343b53d64f4e8ecd2fbab5c356099918e55d8238.zip hdf5-343b53d64f4e8ecd2fbab5c356099918e55d8238.tar.gz hdf5-343b53d64f4e8ecd2fbab5c356099918e55d8238.tar.bz2 |
Merge branch 'develop' into compat_feature_flag
Diffstat (limited to 'test/use_common.c')
-rw-r--r-- | test/use_common.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/test/use_common.c b/test/use_common.c index 908cac9..5aa6692 100644 --- a/test/use_common.c +++ b/test/use_common.c @@ -48,6 +48,8 @@ parse_option(int argc, char * const argv[]) { int ret_value=0; int c; + int use_swmr; /* Need an int to detect errors */ + /* command line options: See function usage for a description */ const char *nagg_options = "f:hi:l:n:s:y:z:"; @@ -96,11 +98,13 @@ parse_option(int argc, char * const argv[]) }; break; case 's': /* use swmr file open mode */ - if ((UC_opts.use_swmr = HDatoi(optarg)) < 0) { - fprintf(stderr, "swmr value should be 0(no) or 1(yes)\n"); - usage(progname_g); - Hgoto_error(-1); - }; + use_swmr = HDatoi(optarg); + if (use_swmr != 0 && use_swmr != 1) { + HDfprintf(stderr, "swmr value should be 0(no) or 1(yes)\n"); + usage(progname_g); + Hgoto_error(-1); + } + UC_opts.use_swmr = (hbool_t)use_swmr; break; case 'y': /* Number of planes per chunk */ if ((UC_opts.chunkplanes = HDstrtoul(optarg, NULL, 0)) <= 0) { |