diff options
author | bapt <bapt@FreeBSD.org> | 2014-01-20 14:37:02 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2014-01-20 14:37:02 +0000 |
commit | bc9afa8bed10defc3946a9cdd6e3a401db21e437 (patch) | |
tree | 359108912685b28eeface542d389b17a88c89a02 /sbin/kldload | |
parent | 567342fbad28f24c8f975470e193ff92da791ea7 (diff) | |
download | FreeBSD-src-bc9afa8bed10defc3946a9cdd6e3a401db21e437.zip FreeBSD-src-bc9afa8bed10defc3946a9cdd6e3a401db21e437.tar.gz |
MFH: r260483, r260484, r260594, r260595, r260596, r260597
Improve error message shown to the user when trying to load a module that is
already loaded or compiled withing the kernel
Point the user to dmesg(1) to get informations about why loading a module did fail
instead of printing the cryptic "Exec format error"
Update the BUGS section of kld(4) according the recent changes in kldload(8)
Diffstat (limited to 'sbin/kldload')
-rw-r--r-- | sbin/kldload/kldload.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sbin/kldload/kldload.c b/sbin/kldload/kldload.c index 84589eb..3891f33 100644 --- a/sbin/kldload/kldload.c +++ b/sbin/kldload/kldload.c @@ -181,7 +181,22 @@ main(int argc, char** argv) printf("%s is already " "loaded\n", argv[0]); } else { - warn("can't load %s", argv[0]); + 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 the module. " + "Please check dmesg(8) for " + "more details."); + break; + default: + warn("can't load %s", argv[0]); + break; + } errors++; } } else { |