Fix incorrect error message in iovctl

If the iovctl command was invoked with only the -C flag, the user would
receive a message claiming that they needed to also supply either the
-d flag or the -f flag.  However, in the case of the -C mode, only the
-f flag is acceptable.  Correct this error message in this case.

PR:		222050
Submitted by:	Heinz N. Gies
Reported by:	Heinz N. Gies
MFC after:	1 week
This commit is contained in:
Ryan Stone 2017-09-12 21:12:04 +00:00
parent 292efb1bc0
commit 7c1b51d6dc

View File

@ -230,17 +230,21 @@ main(int argc, char **argv)
usage();
}
if (device == NULL && filename == NULL) {
if (device == NULL && filename == NULL && action != CONFIG) {
warnx("Either the -d or -f flag must be specified");
usage();
}
switch (action) {
case CONFIG:
if (filename == NULL) {
if (device != NULL) {
warnx("-d flag cannot be used with the -C flag");
usage();
}
if (filename == NULL) {
warnx("The -f flag must be specified");
usage();
}
config_action(filename, dryrun);
break;
case DELETE: