diff --git a/usr.sbin/iovctl/iovctl.c b/usr.sbin/iovctl/iovctl.c index e25320e9b932..0350c732f671 100644 --- a/usr.sbin/iovctl/iovctl.c +++ b/usr.sbin/iovctl/iovctl.c @@ -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: