svn commit: r253302 - stable/9/sbin/nvmecontrol

Jim Harris jimharris at FreeBSD.org
Fri Jul 12 22:16:43 UTC 2013


Author: jimharris
Date: Fri Jul 12 22:16:43 2013
New Revision: 253302
URL: http://svnweb.freebsd.org/changeset/base/253302

Log:
  MFC r253116:
  
    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.
  
  Approved by:	re (kib)

Modified:
  stable/9/sbin/nvmecontrol/identify.c
  stable/9/sbin/nvmecontrol/nvmecontrol.h
Directory Properties:
  stable/9/sbin/nvmecontrol/   (props changed)

Modified: stable/9/sbin/nvmecontrol/identify.c
==============================================================================
--- stable/9/sbin/nvmecontrol/identify.c	Fri Jul 12 22:15:50 2013	(r253301)
+++ stable/9/sbin/nvmecontrol/identify.c	Fri Jul 12 22:16:43 2013	(r253302)
@@ -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: stable/9/sbin/nvmecontrol/nvmecontrol.h
==============================================================================
--- stable/9/sbin/nvmecontrol/nvmecontrol.h	Fri Jul 12 22:15:50 2013	(r253301)
+++ stable/9/sbin/nvmecontrol/nvmecontrol.h	Fri Jul 12 22:16:43 2013	(r253302)
@@ -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"	       \


More information about the svn-src-stable-9 mailing list