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"              \
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to