From owner-svn-src-head@FreeBSD.ORG Tue Jul 9 21:33:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 54E341E7; Tue, 9 Jul 2013 21:33:13 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4706B1E25; Tue, 9 Jul 2013 21:33:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69LXDoO051351; Tue, 9 Jul 2013 21:33:13 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69LXCht051349; Tue, 9 Jul 2013 21:33:12 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307092133.r69LXCht051349@svn.freebsd.org> From: Jim Harris Date: Tue, 9 Jul 2013 21:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253116 - head/sbin/nvmecontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 09 Jul 2013 21:33:13 -0000 Author: jimharris Date: Tue Jul 9 21:33:12 2013 New Revision: 253116 URL: http://svnweb.freebsd.org/changeset/base/253116 Log: Ensure controller or namespace node name is specified before trying to access it. While here, also fix the identify usage message to show the -v and -x parameters. Sponsored by: Intel MFC after: 3 days Modified: head/sbin/nvmecontrol/identify.c head/sbin/nvmecontrol/nvmecontrol.h Modified: head/sbin/nvmecontrol/identify.c ============================================================================== --- head/sbin/nvmecontrol/identify.c Tue Jul 9 21:31:58 2013 (r253115) +++ head/sbin/nvmecontrol/identify.c Tue Jul 9 21:33:12 2013 (r253116) @@ -259,6 +259,10 @@ identify(int argc, char *argv[]) while (getopt(argc, argv, "vx") != -1) ; + /* Check that a controller or namespace was specified. */ + if (optind >= argc) + identify_usage(); + target = argv[optind]; optreset = 1; Modified: head/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.h Tue Jul 9 21:31:58 2013 (r253115) +++ head/sbin/nvmecontrol/nvmecontrol.h Tue Jul 9 21:33:12 2013 (r253116) @@ -38,7 +38,7 @@ " nvmecontrol devlist\n" #define IDENTIFY_USAGE \ -" nvmecontrol identify \n" +" nvmecontrol identify [-x [-v]] \n" #define PERFTEST_USAGE \ " nvmecontrol perftest <-n num_threads> <-o read|write>\n" \