summaryrefslogtreecommitdiffstats
path: root/usr.sbin/cpucontrol/cpucontrol.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2017-10-07 08:42:36 +0000
committerLuiz Souza <luiz@netgate.com>2018-02-19 14:48:44 -0300
commit8926fdba02d1f614e3919986cdb7cae9949ebe76 (patch)
treed1e996ed69abdddb2d1b5bba283808d161f4932f /usr.sbin/cpucontrol/cpucontrol.c
parent457061d949ae73e58071fe42a7430d13af05e237 (diff)
downloadFreeBSD-src-8926fdba02d1f614e3919986cdb7cae9949ebe76.zip
FreeBSD-src-8926fdba02d1f614e3919986cdb7cae9949ebe76.tar.gz
MFC r324113:
Allow to disable default microcode updates search path with the new '-n' option. (cherry picked from commit ea3420cd5630af68a7faa4bff6a89f03d0c32022)
Diffstat (limited to 'usr.sbin/cpucontrol/cpucontrol.c')
-rw-r--r--usr.sbin/cpucontrol/cpucontrol.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/cpucontrol/cpucontrol.c b/usr.sbin/cpucontrol/cpucontrol.c
index 48e12e7..6760b83 100644
--- a/usr.sbin/cpucontrol/cpucontrol.c
+++ b/usr.sbin/cpucontrol/cpucontrol.c
@@ -60,6 +60,7 @@ int verbosity_level = 0;
#define FLAG_I 0x01
#define FLAG_M 0x02
#define FLAG_U 0x04
+#define FLAG_N 0x08
#define OP_INVAL 0x00
#define OP_READ 0x01
@@ -427,11 +428,7 @@ main(int argc, char *argv[])
error = 0;
cmdarg = ""; /* To keep gcc3 happy. */
- /*
- * Add all default data dirs to the list first.
- */
- datadir_add(DEFAULT_DATADIR);
- while ((c = getopt(argc, argv, "d:hi:m:uv")) != -1) {
+ while ((c = getopt(argc, argv, "d:hi:m:nuv")) != -1) {
switch (c) {
case 'd':
datadir_add(optarg);
@@ -444,6 +441,9 @@ main(int argc, char *argv[])
flags |= FLAG_M;
cmdarg = optarg;
break;
+ case 'n':
+ flags |= FLAG_N;
+ break;
case 'u':
flags |= FLAG_U;
break;
@@ -463,6 +463,8 @@ main(int argc, char *argv[])
usage();
/* NOTREACHED */
}
+ if ((flags & FLAG_N) == 0)
+ datadir_add(DEFAULT_DATADIR);
dev = argv[0];
c = flags & (FLAG_I | FLAG_M | FLAG_U);
switch (c) {
OpenPOWER on IntegriCloud