From owner-svn-src-all@freebsd.org Tue Sep 12 21:12:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8851E1E485; Tue, 12 Sep 2017 21:12:05 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E1323927; Tue, 12 Sep 2017 21:12:05 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8CLC42F030435; Tue, 12 Sep 2017 21:12:04 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8CLC4qA030434; Tue, 12 Sep 2017 21:12:04 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201709122112.v8CLC4qA030434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Tue, 12 Sep 2017 21:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323506 - head/usr.sbin/iovctl X-SVN-Group: head X-SVN-Commit-Author: rstone X-SVN-Commit-Paths: head/usr.sbin/iovctl X-SVN-Commit-Revision: 323506 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2017 21:12:06 -0000 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);