From owner-svn-src-stable-9@FreeBSD.ORG Mon Jan 20 15:33:32 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CEE8B151; Mon, 20 Jan 2014 15:33:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A068A1B04; Mon, 20 Jan 2014 15:33:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0KFXW94037233; Mon, 20 Jan 2014 15:33:32 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0KFXWh6037228; Mon, 20 Jan 2014 15:33:32 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201401201533.s0KFXWh6037228@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 20 Jan 2014 15:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r260909 - in stable/9: sbin/kldload share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jan 2014 15:33:32 -0000 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