Loading libmodprobe/libmodprobe.cpp +16 −13 Original line number Diff line number Diff line Loading @@ -458,14 +458,16 @@ bool Modprobe::InsmodWithDeps(const std::string& module_name, const std::string& bool Modprobe::LoadWithAliases(const std::string& module_name, bool strict, const std::string& parameters) { std::set<std::string> modules_to_load; bool module_loaded = false; { std::lock_guard guard(module_loaded_lock_); auto canonical_name = MakeCanonical(module_name); if (module_loaded_.count(canonical_name)) { return true; } std::set<std::string> modules_to_load = {canonical_name}; bool module_loaded = false; modules_to_load.insert(std::move(canonical_name)); // use aliases to expand list of modules to load (multiple modules // may alias themselves to the requested name) for (const auto& [alias, aliased_module] : module_aliases_) { Loading @@ -474,6 +476,7 @@ bool Modprobe::LoadWithAliases(const std::string& module_name, bool strict, if (module_loaded_.count(MakeCanonical(aliased_module))) continue; modules_to_load.emplace(aliased_module); } } // attempt to load all modules aliased to this name for (const auto& module : modules_to_load) { Loading Loading
libmodprobe/libmodprobe.cpp +16 −13 Original line number Diff line number Diff line Loading @@ -458,14 +458,16 @@ bool Modprobe::InsmodWithDeps(const std::string& module_name, const std::string& bool Modprobe::LoadWithAliases(const std::string& module_name, bool strict, const std::string& parameters) { std::set<std::string> modules_to_load; bool module_loaded = false; { std::lock_guard guard(module_loaded_lock_); auto canonical_name = MakeCanonical(module_name); if (module_loaded_.count(canonical_name)) { return true; } std::set<std::string> modules_to_load = {canonical_name}; bool module_loaded = false; modules_to_load.insert(std::move(canonical_name)); // use aliases to expand list of modules to load (multiple modules // may alias themselves to the requested name) for (const auto& [alias, aliased_module] : module_aliases_) { Loading @@ -474,6 +476,7 @@ bool Modprobe::LoadWithAliases(const std::string& module_name, bool strict, if (module_loaded_.count(MakeCanonical(aliased_module))) continue; modules_to_load.emplace(aliased_module); } } // attempt to load all modules aliased to this name for (const auto& module : modules_to_load) { Loading