diff options
author | Juraj Lutter <otis@FreeBSD.org> | 2022-06-17 13:36:53 +0000 |
---|---|---|
committer | Juraj Lutter <otis@FreeBSD.org> | 2022-07-01 15:16:22 +0000 |
commit | 7c500f98b8d3068ef3601819c819266a8dbbba11 (patch) | |
tree | a11e96c3e6d49955451fe213da363a73bb444182 /sbin/kldload | |
parent | 66754c01ff951a771c594dd850675ba2c4236dcc (diff) | |
download | src-7c500f98b8d3068ef3601819c819266a8dbbba11.tar.gz src-7c500f98b8d3068ef3601819c819266a8dbbba11.zip |
kldload: Bring functionality in line with manual page
Honor -q parameter and do not display any warning messages when -q is
specified.
Approved by: dfr
MFC after: 2 weeks
Sponsored by: Resulta, s.r.o.
Differential Revision: https://reviews.freebsd.org/D35511
(cherry picked from commit ad0a7ea65084e997f21fdb4724120e850b20659b)
Diffstat (limited to 'sbin/kldload')
-rw-r--r-- | sbin/kldload/kldload.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/sbin/kldload/kldload.c b/sbin/kldload/kldload.c index 254a409cd2a7..a8e43fdd1f92 100644 --- a/sbin/kldload/kldload.c +++ b/sbin/kldload/kldload.c @@ -171,21 +171,23 @@ main(int argc, char** argv) printf("%s is already " "loaded\n", argv[0]); } else { - switch (errno) { - case EEXIST: - warnx("can't load %s: module " - "already loaded or " - "in kernel", argv[0]); - break; - case ENOEXEC: - warnx("an error occurred while " - "loading module %s. " - "Please check dmesg(8) for " - "more details.", argv[0]); - break; - default: - warn("can't load %s", argv[0]); - break; + if (!quiet) { + switch (errno) { + case EEXIST: + warnx("can't load %s: module " + "already loaded or " + "in kernel", argv[0]); + break; + case ENOEXEC: + warnx("an error occurred while " + "loading module %s. " + "Please check dmesg(8) for " + "more details.", argv[0]); + break; + default: + warn("can't load %s", argv[0]); + break; + } } errors++; } |