From owner-svn-src-stable-10@freebsd.org Thu Jan 28 12:22:16 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84A60A71236; Thu, 28 Jan 2016 12:22:16 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5377B1C8F; Thu, 28 Jan 2016 12:22:16 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SCMFGg063241; Thu, 28 Jan 2016 12:22:15 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SCMFck063240; Thu, 28 Jan 2016 12:22:15 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601281222.u0SCMFck063240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 28 Jan 2016 12:22:15 +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: r294984 - stable/10/sys/boot/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 12:22:16 -0000 Author: smh Date: Thu Jan 28 12:22:15 2016 New Revision: 294984 URL: https://svnweb.freebsd.org/changeset/base/294984 Log: MFC r286234 (by trasz): Fix a problem which made loader(8) load non-kld files twice. Sponsored by: Multiplay Modified: stable/10/sys/boot/common/module.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/common/module.c ============================================================================== --- stable/10/sys/boot/common/module.c Thu Jan 28 12:21:23 2016 (r294983) +++ stable/10/sys/boot/common/module.c Thu Jan 28 12:22:15 2016 (r294984) @@ -101,6 +101,7 @@ COMMAND_SET(load, "load", "load a kernel static int command_load(int argc, char *argv[]) { + struct preloaded_file *fp; char *typestr; int dofile, dokld, ch, error; @@ -138,6 +139,13 @@ command_load(int argc, char *argv[]) command_errmsg = "invalid load type"; return(CMD_ERROR); } + + fp = file_findfile(argv[1], typestr); + if (fp) { + sprintf(command_errbuf, "warning: file '%s' already loaded", argv[1]); + return (CMD_ERROR); + } + return (file_loadraw(argv[1], typestr, 1) ? CMD_OK : CMD_ERROR); } /*