diff options
| author | Enji Cooper <ngie@FreeBSD.org> | 2017-04-22 22:34:45 +0000 |
|---|---|---|
| committer | Enji Cooper <ngie@FreeBSD.org> | 2017-04-22 22:34:45 +0000 |
| commit | 29924a1c128739dd405d5463ee03458382f2f403 (patch) | |
| tree | 4050c9b05a5e2808ed9622f215ccc85d801505f0 /tools | |
| parent | 22c00e3b850fa93bd6979d6c9b8297c05f0bdf84 (diff) | |
Notes
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/regression/geom_gpt/gctl_test_helper.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/regression/geom_gpt/gctl_test_helper.c b/tools/regression/geom_gpt/gctl_test_helper.c index ac5ee4a637b3..48440d037a9f 100644 --- a/tools/regression/geom_gpt/gctl_test_helper.c +++ b/tools/regression/geom_gpt/gctl_test_helper.c @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <assert.h> +#include <err.h> #include <errno.h> #include <limits.h> #include <stdio.h> @@ -113,7 +114,7 @@ main(int argc, char *argv[]) struct gctl_req *req; char *param, *value; const char *s; - int c, len; + int c, len, parse_retval; req = gctl_get_handle(); assert(req != NULL); @@ -132,8 +133,9 @@ main(int argc, char *argv[]) } } - while (optind < argc) { - if (!parse(argv[optind++], ¶m, &value, &len)) { + for (; optind < argc; optind++) { + parse_retval = parse(argv[optind], ¶m, &value, &len); + if (parse_retval == 0) { if (len > 0) { rv = malloc(sizeof(struct retval)); assert(rv != NULL); @@ -144,7 +146,9 @@ main(int argc, char *argv[]) gctl_rw_param(req, param, len, value); } else gctl_ro_param(req, param, -1, value); - } + } else + warnc(parse_retval, "failed to parse argument (%s)", + argv[optind]); } if (verbose) |
