diff options
author | smh <smh@FreeBSD.org> | 2016-01-28 12:22:15 +0000 |
---|---|---|
committer | smh <smh@FreeBSD.org> | 2016-01-28 12:22:15 +0000 |
commit | 74468e18e88bab67e6156ce77460505c1ebf4df0 (patch) | |
tree | f25f419c9522ad39f2c46cbec0c61f5abe24aad9 /sys/boot | |
parent | 8b5dc50539615fa69e9ab67431908e0e9072482d (diff) | |
download | FreeBSD-src-74468e18e88bab67e6156ce77460505c1ebf4df0.zip FreeBSD-src-74468e18e88bab67e6156ce77460505c1ebf4df0.tar.gz |
MFC r286234 (by trasz):
Fix a problem which made loader(8) load non-kld files twice.
Sponsored by: Multiplay
Diffstat (limited to 'sys/boot')
-rw-r--r-- | sys/boot/common/module.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/boot/common/module.c b/sys/boot/common/module.c index a0c27dc..0fc970a 100644 --- a/sys/boot/common/module.c +++ b/sys/boot/common/module.c @@ -101,6 +101,7 @@ COMMAND_SET(load, "load", "load a kernel or module", command_load); 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); } /* |