From owner-svn-src-all@FreeBSD.ORG Mon Jan 20 14:37:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C59CD410; Mon, 20 Jan 2014 14:37:03 +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 9658F1678; Mon, 20 Jan 2014 14:37:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0KEb3wF014299; Mon, 20 Jan 2014 14:37:03 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0KEb3Ae014297; Mon, 20 Jan 2014 14:37:03 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201401201437.s0KEb3Ae014297@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 20 Jan 2014 14:37:03 +0000 (UTC) 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 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jan 2014 14:37:03 -0000 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