Date: Tue, 9 Jul 2013 21:33:12 +0000 (UTC) From: Jim Harris <jimharris@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253116 - head/sbin/nvmecontrol Message-ID: <201307092133.r69LXCht051349@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <controller id|namespace id>\n" +" nvmecontrol identify [-x [-v]] <controller id|namespace id>\n" #define PERFTEST_USAGE \ " nvmecontrol perftest <-n num_threads> <-o read|write>\n" \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307092133.r69LXCht051349>