aboutsummaryrefslogtreecommitdiff
path: root/sbin/kldload
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2014-01-13 16:23:09 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2014-01-13 16:23:09 +0000
commit10c916252f20d41b6d29aa85feba8f337ebbff7f (patch)
tree0f2e8ba32636cbf463264eaf1fca4cbd65936e9e /sbin/kldload
parenta0d53e0b384c1f7d63d0f7277a8adb594eec7230 (diff)
downloadsrc-10c916252f20d41b6d29aa85feba8f337ebbff7f.tar.gz
src-10c916252f20d41b6d29aa85feba8f337ebbff7f.zip
Point the user to dmesg(1) to get informations about why loading a module did fail
instead of printing the cryptic "Exec format error" MFC after: 1 week
Notes
Notes: svn path=/head/; revision=260594
Diffstat (limited to 'sbin/kldload')
-rw-r--r--sbin/kldload/kldload.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sbin/kldload/kldload.c b/sbin/kldload/kldload.c
index 6e88546bd4e3..02b34cef2842 100644
--- a/sbin/kldload/kldload.c
+++ b/sbin/kldload/kldload.c
@@ -181,12 +181,22 @@ main(int argc, char** argv)
printf("%s is already "
"loaded\n", argv[0]);
} else {
- if (errno == EEXIST)
+ switch (errno) {
+ case EEXIST:
warnx("can't load %s: module "
"already loaded or "
"in kernel", argv[0]);
- else
+ break;
+ case ENOEXEC:
+ warnx("an error occured while "
+ "loading the module. "
+ "Please check dmesg(1) for "
+ "more details.");
+ break;
+ default:
warn("can't load %s", argv[0]);
+ break;
+ }
errors++;
}
} else {