Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Jan 2014 15:34:23 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r260483 - head/sbin/kldload
Message-ID:  <201401091534.s09FYNQO096795@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Thu Jan  9 15:34:23 2014
New Revision: 260483
URL: http://svnweb.freebsd.org/changeset/base/260483

Log:
  Import error message shown to the user when trying to load a module that is
  already loaded or compiled withing the kernel
  
  MFC after:	1 week

Modified:
  head/sbin/kldload/kldload.c

Modified: head/sbin/kldload/kldload.c
==============================================================================
--- head/sbin/kldload/kldload.c	Thu Jan  9 15:31:44 2014	(r260482)
+++ head/sbin/kldload/kldload.c	Thu Jan  9 15:34:23 2014	(r260483)
@@ -181,8 +181,14 @@ main(int argc, char** argv)
 						printf("%s is already "
 						    "loaded\n", argv[0]);
 				} else {
-					warn("can't load %s", argv[0]);
-					errors++;
+					if (errno == EEXIST) {
+						warnx("can't load %s: module "
+						    "already loaded or "
+						    "in kernel", argv[0]);
+					} else {
+						warn("can't load %s", argv[0]);
+						errors++;
+					}
 				}
 			} else {
 				if (verbose)



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