Author: hselasky
Date: Thu May 16 16:37:00 2019
New Revision: 347779
URL: https://svnweb.freebsd.org/changeset/base/347779

Log:
  MFC r347314:
  Ensure that only one command is specified at a time in mlx5tool(8).
  
  Submitted by: kib@
  Sponsored by: Mellanox Technologies

Modified:
  stable/12/usr.sbin/mlx5tool/mlx5tool.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/mlx5tool/mlx5tool.c
==============================================================================
--- stable/12/usr.sbin/mlx5tool/mlx5tool.c      Thu May 16 16:36:10 2019        
(r347778)
+++ stable/12/usr.sbin/mlx5tool/mlx5tool.c      Thu May 16 16:37:00 2019        
(r347779)
@@ -244,22 +244,32 @@ main(int argc, char *argv[])
                        addrstr = optarg;
                        break;
                case 'w':
+                       if (act != ACTION_NONE)
+                               usage();
                        act = ACTION_DUMP_GET;
                        break;
                case 'e':
+                       if (act != ACTION_NONE)
+                               usage();
                        act = ACTION_DUMP_FORCE;
                        break;
                case 'o':
                        dumpname = optarg;
                        break;
                case 'r':
+                       if (act != ACTION_NONE)
+                               usage();
                        act = ACTION_DUMP_RESET;
                        break;
                case 'f':
+                       if (act != ACTION_NONE)
+                               usage();
                        act = ACTION_FW_UPDATE;
                        img_fw_path = optarg;
                        break;
                case 'z':
+                       if (act != ACTION_NONE)
+                               usage();
                        act = ACTION_FW_RESET;
                        break;
                case 'h':
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to