Repository: mesos Updated Branches: refs/heads/master c818fe6e5 -> 718f40a35
Replaced ModuleManager::expandLibraryName with os::libraries::expandName. Review: https://reviews.apache.org/r/26904 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/718f40a3 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/718f40a3 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/718f40a3 Branch: refs/heads/master Commit: 718f40a35e0ded9d4770bebc5344d3909dd20bb2 Parents: c818fe6 Author: Kapil Arya <[email protected]> Authored: Mon Oct 20 17:23:06 2014 -0700 Committer: Niklas Q. Nielsen <[email protected]> Committed: Mon Oct 20 17:48:04 2014 -0700 ---------------------------------------------------------------------- src/module/manager.cpp | 2 +- src/module/manager.hpp | 10 ---------- src/tests/module_tests.cpp | 4 ++-- 3 files changed, 3 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/718f40a3/src/module/manager.cpp ---------------------------------------------------------------------- diff --git a/src/module/manager.cpp b/src/module/manager.cpp index 2727fe0..105e5af 100644 --- a/src/module/manager.cpp +++ b/src/module/manager.cpp @@ -180,7 +180,7 @@ Try<Nothing> ModuleManager::load(const Modules& modules) if (library.has_file()) { libraryName = library.file(); } else if (library.has_name()) { - libraryName = expandLibraryName(library.name()); + libraryName = os::libraries::expandName(library.name()); } else { return Error("Library name or path not provided"); } http://git-wip-us.apache.org/repos/asf/mesos/blob/718f40a3/src/module/manager.hpp ---------------------------------------------------------------------- diff --git a/src/module/manager.hpp b/src/module/manager.hpp index 56e2af3..1c93ac4 100644 --- a/src/module/manager.hpp +++ b/src/module/manager.hpp @@ -89,16 +89,6 @@ public: return kind; } - static std::string expandLibraryName(const std::string& libraryName) - { -#ifdef __linux__ - const char* libraryExtension = ".so"; -#else - const char* libraryExtension = ".dylib"; -#endif - return "lib" + libraryName + libraryExtension; - } - // Exposed just for testing so that we can unload a given // module and remove it from the list of ModuleBases. static Try<Nothing> unload(const std::string& moduleName); http://git-wip-us.apache.org/repos/asf/mesos/blob/718f40a3/src/tests/module_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/module_tests.cpp b/src/tests/module_tests.cpp index 54e1e8d..7dd47fb 100644 --- a/src/tests/module_tests.cpp +++ b/src/tests/module_tests.cpp @@ -48,7 +48,7 @@ static const string getLibraryPath(const string& libraryName) { return path::join( getLibraryDirectory(), - ModuleManager::expandLibraryName(libraryName)); + os::libraries::expandName(libraryName)); } @@ -140,7 +140,7 @@ TEST_F(ModuleTest, LibraryNameWithoutExtension) // found in LD_LIBRARY_PATH. TEST_F(ModuleTest, LibraryNameWithExtension) { - const string libraryName = ModuleManager::expandLibraryName("examplemodule"); + const string libraryName = os::libraries::expandName("examplemodule"); const string moduleName = "org_apache_mesos_TestModule"; const string ldLibraryPath = "LD_LIBRARY_PATH";
