svn commit: r323506 - head/usr.sbin/iovctl

Ryan Stone rstone at FreeBSD.org
Tue Sep 12 21:12:06 UTC 2017


Author: rstone
Date: Tue Sep 12 21:12:04 2017
New Revision: 323506
URL: https://svnweb.freebsd.org/changeset/base/323506

Log:
  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

Modified:
  head/usr.sbin/iovctl/iovctl.c

Modified: head/usr.sbin/iovctl/iovctl.c
==============================================================================
--- head/usr.sbin/iovctl/iovctl.c	Tue Sep 12 21:08:50 2017	(r323505)
+++ head/usr.sbin/iovctl/iovctl.c	Tue Sep 12 21:12:04 2017	(r323506)
@@ -230,15 +230,19 @@ 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);


More information about the svn-src-all mailing list