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);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to