Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142644519
D45731.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D45731.id.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D45731: stand: module: unlink the entire tail when dependencies fail to load
Attached
Detach File
Event Timeline
Log In to Comment