From owner-svn-src-head@FreeBSD.ORG Thu Feb 19 20:45:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DB5E106566B; Thu, 19 Feb 2009 20:45:38 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C0818FC23; Thu, 19 Feb 2009 20:45:38 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1JKjcFB007413; Thu, 19 Feb 2009 20:45:38 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JKjc2g007412; Thu, 19 Feb 2009 20:45:38 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200902192045.n1JKjc2g007412@svn.freebsd.org> From: Roman Divacky Date: Thu, 19 Feb 2009 20:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188829 - head/sbin/atacontrol X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 20:45:38 -0000 Author: rdivacky Date: Thu Feb 19 20:45:37 2009 New Revision: 188829 URL: http://svn.freebsd.org/changeset/base/188829 Log: Display an error message when the requested mode is not known. So the user can distinguish between a typo in the mode name and that the device does not support a certain mode (till now both causes show the same result, i.e. the old mode is displayed). Submitted by: Christoph Mallon Approved by: kib (mentor) Modified: head/sbin/atacontrol/atacontrol.c Modified: head/sbin/atacontrol/atacontrol.c ============================================================================== --- head/sbin/atacontrol/atacontrol.c Thu Feb 19 20:07:59 2009 (r188828) +++ head/sbin/atacontrol/atacontrol.c Thu Feb 19 20:45:37 2009 (r188829) @@ -364,6 +364,8 @@ main(int argc, char **argv) fd = open_dev(argv[2], O_RDONLY); if (argc == 4) { mode = str2mode(argv[3]); + if (mode == -1) + errx(1, "unknown mode"); if (ioctl(fd, IOCATASMODE, &mode) < 0) warn("ioctl(IOCATASMODE)"); }