Page MenuHomeFreeBSD

D45731.id.diff
No OneTemporary

D45731.id.diff

diff --git a/stand/common/module.c b/stand/common/module.c
--- a/stand/common/module.c
+++ b/stand/common/module.c
@@ -64,6 +64,7 @@
static char * mod_searchmodule_pnpinfo(const char *bus, const char *pnpinfo);
static void file_insert_tail(struct preloaded_file *mp);
static void file_remove(struct preloaded_file *fp);
+static void file_remove_tail(struct preloaded_file *fp);
struct file_metadata* metadata_next(struct file_metadata *base_mp, int type);
static void moduledir_readhints(struct moduledir *mdp);
static void moduledir_rebuild(void);
@@ -876,7 +877,7 @@
file_insert_tail(fp); /* Add to the list of loaded files */
if (file_load_dependencies(fp) != 0) {
err = ENOENT;
- file_remove(fp);
+ file_remove_tail(fp);
loadaddr = loadaddr_saved;
fp = NULL;
break;
@@ -1637,25 +1638,45 @@
* Remove module from the chain
*/
static void
-file_remove(struct preloaded_file *fp)
+file_remove_impl(struct preloaded_file *fp, bool keep_tail)
{
- struct preloaded_file *cm;
+ struct preloaded_file *cm, *next;
if (preloaded_files == NULL)
return;
+ if (keep_tail)
+ next = fp->f_next;
+ else
+ next = NULL;
+
if (preloaded_files == fp) {
- preloaded_files = fp->f_next;
+ preloaded_files = next;
return;
}
+
for (cm = preloaded_files; cm->f_next != NULL; cm = cm->f_next) {
if (cm->f_next == fp) {
- cm->f_next = fp->f_next;
+ cm->f_next = next;
return;
}
}
}
+static void
+file_remove(struct preloaded_file *fp)
+{
+
+ file_remove_impl(fp, true);
+}
+
+static void
+file_remove_tail(struct preloaded_file *fp)
+{
+
+ file_remove_impl(fp, false);
+}
+
static char *
moduledir_fullpath(struct moduledir *mdp, const char *fname)
{

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 22, 7:44 PM (21 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27851547
Default Alt Text
D45731.id.diff (1 KB)

Event Timeline