Date: Thu, 28 Jan 2016 12:22:15 +0000 (UTC) From: Steven Hartland <smh@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: r294984 - stable/10/sys/boot/common Message-ID: <201601281222.u0SCMFck063240@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601281222.u0SCMFck063240>