svn commit: r260909 - in stable/9: sbin/kldload share/man/man4

Baptiste Daroussin bapt at FreeBSD.org
Mon Jan 20 15:33:32 UTC 2014


Author: bapt
Date: Mon Jan 20 15:33:31 2014
New Revision: 260909
URL: http://svnweb.freebsd.org/changeset/base/260909

Log:
  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)

Modified:
  stable/9/sbin/kldload/kldload.c
  stable/9/share/man/man4/kld.4
Directory Properties:
  stable/9/sbin/   (props changed)
  stable/9/sbin/kldload/   (props changed)
  stable/9/share/   (props changed)
  stable/9/share/man/   (props changed)
  stable/9/share/man/man4/   (props changed)

Modified: stable/9/sbin/kldload/kldload.c
==============================================================================
--- stable/9/sbin/kldload/kldload.c	Mon Jan 20 15:00:21 2014	(r260908)
+++ stable/9/sbin/kldload/kldload.c	Mon Jan 20 15:33:31 2014	(r260909)
@@ -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 {

Modified: stable/9/share/man/man4/kld.4
==============================================================================
--- stable/9/share/man/man4/kld.4	Mon Jan 20 15:00:21 2014	(r260908)
+++ stable/9/share/man/man4/kld.4	Mon Jan 20 15:33:31 2014	(r260909)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 8, 1998
+.Dd January 13, 2014
 .Dt KLD 4
 .Os
 .Sh NAME
@@ -166,8 +166,8 @@ binary, then
 fails to execute the entry point.
 .Pp
 .Xr kldload 8
-returns the cryptic message
-.Sq Li "ENOEXEC (Exec format error)"
+points the user to read
+.Xr dmesg 8
 for any error encountered while loading a module.
 .Pp
 When system internal interfaces change, old modules often cannot


More information about the svn-src-stable-9 mailing list