From e4cf172727ffbdfb0354191d691f959ddfd8519e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 8 Sep 2003 04:06:14 +0000 Subject: [PATCH] Since Ingo found out that BeOS requires the module name and its location on disk to match to be able to find it, changed the ToDo: comment in the affected function, and added a test call to vfs_get_module_name(); our bootfs cannot handle the path depth/length required to be a useful module host, so we still have our recursive search algorithm in place for now. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4560 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/module.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/kernel/core/module.c b/src/kernel/core/module.c index 1d94c517c3..dec25abb91 100644 --- a/src/kernel/core/module.c +++ b/src/kernel/core/module.c @@ -511,15 +511,26 @@ search_module(const char *name) TRACE(("search_module(%s)\n", name)); - // ToDo: this could take parts of the module name to check there for - // the module first, since module names are usually path/name/version - // anyway. - // It might even be the convention to do so on BeOS! Please check! + // ToDo: As Ingo found out, BeOS uses the module name to locate the module + // on disk. We now have the vfs_get_module_path() call to achieve this. + // As soon as we boot from a file system other than bootfs, we should + // change the loading behaviour to only use that function (bootfs has + // a very low maximum path length, which makes it unable to contain + // the standard module directories). + // The call to vfs_get_module_path() is only for testing purposes for (i = 0; i < NUM_MODULE_PATHS; i++) { if (modules_disable_user_addons && i >= USER_MODULE_PATHS) return NULL; + { + char path[B_FILE_NAME_LENGTH]; + if (vfs_get_module_path(gModulePaths[i], name, path, sizeof(path)) < B_OK) { + TRACE(("vfs_get_module_path() failed for \"%s\"\n", name)); + } else { + TRACE(("vfs_get_module_path(): found \"%s\" (for \"%s\")\n", path, name)); + } + } if ((status = recurse_directory(gModulePaths[i], name)) == B_OK) break; }