Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Jan 2014 14:37:03 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r260906 - in stable/10: sbin/kldload share/man/man4
Message-ID:  <201401201437.s0KEb3Ae014297@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Mon Jan 20 14:37:02 2014
New Revision: 260906
URL: http://svnweb.freebsd.org/changeset/base/260906

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/10/sbin/kldload/kldload.c
  stable/10/share/man/man4/kld.4
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/kldload/kldload.c
==============================================================================
--- stable/10/sbin/kldload/kldload.c	Mon Jan 20 12:11:47 2014	(r260905)
+++ stable/10/sbin/kldload/kldload.c	Mon Jan 20 14:37:02 2014	(r260906)
@@ -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/10/share/man/man4/kld.4
==============================================================================
--- stable/10/share/man/man4/kld.4	Mon Jan 20 12:11:47 2014	(r260905)
+++ stable/10/share/man/man4/kld.4	Mon Jan 20 14:37:02 2014	(r260906)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401201437.s0KEb3Ae014297>