summaryrefslogtreecommitdiffstats
path: root/sbin/kldstat/kldstat.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/kldstat/kldstat.c')
-rw-r--r--sbin/kldstat/kldstat.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sbin/kldstat/kldstat.c b/sbin/kldstat/kldstat.c
index 20404d6..f9fd2c1 100644
--- a/sbin/kldstat/kldstat.c
+++ b/sbin/kldstat/kldstat.c
@@ -87,11 +87,12 @@ main(int argc, char** argv)
int c;
int verbose = 0;
int fileid = 0;
+ int quiet = 0;
char* filename = NULL;
char* modname = NULL;
char* p;
- while ((c = getopt(argc, argv, "i:m:n:v")) != -1)
+ while ((c = getopt(argc, argv, "i:m:n:qv")) != -1)
switch (c) {
case 'i':
fileid = (int)strtoul(optarg, &p, 10);
@@ -104,6 +105,9 @@ main(int argc, char** argv)
case 'n':
filename = optarg;
break;
+ case 'q':
+ quiet = 1;
+ break;
case 'v':
verbose = 1;
break;
@@ -120,8 +124,13 @@ main(int argc, char** argv)
int modid;
struct module_stat stat;
- if ((modid = modfind(modname)) < 0)
- err(1, "can't find module %s", modname);
+ if ((modid = modfind(modname)) < 0) {
+ if (!quiet)
+ warn("can't find module %s", modname);
+ return 1;
+ } else if (quiet) {
+ return 0;
+ }
stat.version = sizeof(struct module_stat);
if (modstat(modid, &stat) < 0)
OpenPOWER on IntegriCloud