Author: imp
Date: Sun Dec  2 23:12:48 2018
New Revision: 341411
URL: https://svnweb.freebsd.org/changeset/base/341411

Log:
  Return after we find the dispatched function.
  
  If the dispatched function doesn't exit, then we get can get a
  spurious function not found message. They all do exit, but this is a
  little cleaner.
  
  Sponsored by: Netflix
  Differential Revision: https://reviews.freebsd.org/D18403

Modified:
  head/sbin/nvmecontrol/nvmecontrol.c

Modified: head/sbin/nvmecontrol/nvmecontrol.c
==============================================================================
--- head/sbin/nvmecontrol/nvmecontrol.c Sun Dec  2 23:12:37 2018        
(r341410)
+++ head/sbin/nvmecontrol/nvmecontrol.c Sun Dec  2 23:12:48 2018        
(r341411)
@@ -73,8 +73,10 @@ dispatch_set(int argc, char *argv[], struct nvme_funct
        }
 
        while (f < tbl_limit) {
-               if (strcmp(argv[1], (*f)->name) == 0)
+               if (strcmp(argv[1], (*f)->name) == 0) {
                        (*f)->fn(argc-1, &argv[1]);
+                       return;
+               }
                f++;
        }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to