* The module iteration code now ignores entries named "dev", and "bin" - this

reduced the boot time in VMware by several seconds, and should also help with
  booting from CD.
* Added TODOs on how to further improve the situation in the future.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31672 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-07-21 12:33:15 +00:00
parent 13aa1795dd
commit a64c204e23
+10 -3
View File
@@ -956,6 +956,9 @@ nextPath:
}
nextModuleImage:
// TODO: remember which directories were already scanned, and don't search
// through them again, unless they change (use DirectoryWatcher)
if (iterator->current_header == NULL) {
// get next entry from the current directory
@@ -989,9 +992,13 @@ nextModuleImage:
goto nextModuleImage;
}
// we're not interested in traversing these again
// we're not interested in traversing these (again)
if (!strcmp(dirent->d_name, ".")
|| !strcmp(dirent->d_name, ".."))
|| !strcmp(dirent->d_name, "..")
// TODO: this is a bit unclean, as we actually only want to prevent
// drivers/bin and drivers/dev to be scanned
|| !strcmp(dirent->d_name, "bin")
|| !strcmp(dirent->d_name, "dev"))
goto nextModuleImage;
// build absolute path to current file
@@ -1014,7 +1021,7 @@ nextModuleImage:
if (S_ISDIR(stat.st_mode)) {
status = iterator_push_path_on_stack(iterator,
iterator->current_module_path, iterator->path_base_length);
if (status < B_OK)
if (status != B_OK)
return status;
iterator->current_module_path = NULL;