git: 7c500f98b8d3 - stable/13 - kldload: Bring functionality in line with manual page
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 01 Jul 2022 15:21:01 UTC
The branch stable/13 has been updated by otis (ports committer):
URL: https://cgit.FreeBSD.org/src/commit/?id=7c500f98b8d3068ef3601819c819266a8dbbba11
commit 7c500f98b8d3068ef3601819c819266a8dbbba11
Author: Juraj Lutter <otis@FreeBSD.org>
AuthorDate: 2022-06-17 13:36:53 +0000
Commit: Juraj Lutter <otis@FreeBSD.org>
CommitDate: 2022-07-01 15:16:22 +0000
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)
---
sbin/kldload/kldload.c | 32 +++++++++++++++++---------------
1 file 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++;
}