svn commit: r294984 - stable/10/sys/boot/common

Steven Hartland smh at FreeBSD.org
Thu Jan 28 12:22:16 UTC 2016


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);
     }
     /*


More information about the svn-src-all mailing list