diff options
author | Timo Lotterbach <timo.lotterbach@bmw-carit.de> | 2013-03-18 14:31:55 +0100 |
---|---|---|
committer | Timo Lotterbach <timo.lotterbach@bmw-carit.de> | 2013-03-19 12:03:03 +0100 |
commit | 19b32f223845b37200a5c2ebb41ef96a5a8b30d4 (patch) | |
tree | 2031fff318a397afd4ca90da725305b9d81cf90d | |
parent | 39b8375a1c147d6b506cc28136d5ec318c973c37 (diff) | |
download | layer_management-19b32f223845b37200a5c2ebb41ef96a5a8b30d4.tar.gz |
LayerManagerBase: fixed portability issue in plugin loading1_0_rc2
on some platforms the type of directy entries always returns DT_UNKNOWN,
this makes it impossible to make a distinction between files and directories.
The plugin searching routing was updated to not rely on the directory
entry type information, it just tries to load each entry found.
Signed-off-by: Timo Lotterbach <timo.lotterbach@bmw-carit.de>
-rw-r--r-- | LayerManagerBase/src/PluginManager.cpp | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/LayerManagerBase/src/PluginManager.cpp b/LayerManagerBase/src/PluginManager.cpp index 198dead..929497d 100644 --- a/LayerManagerBase/src/PluginManager.cpp +++ b/LayerManagerBase/src/PluginManager.cpp @@ -177,7 +177,6 @@ void PluginManager::getAllFilesInPluginPath(std::string path) while (directory && (itemInDirectory = readdir(directory))) { - unsigned char entryType = itemInDirectory->d_type; std::string entryName = itemInDirectory->d_name; std::string fullPath = path + "/" + entryName; @@ -186,23 +185,9 @@ void PluginManager::getAllFilesInPluginPath(std::string path) continue; } - switch (entryType) - { - case DT_REG: - case DT_LNK: - case DT_UNKNOWN: - mFileList.push_back(fullPath); - LOG_DEBUG("PluginManager", "considering File " << fullPath); - break; - - case DT_DIR: - getAllFilesInPluginPath(fullPath); - break; - - default: - LOG_DEBUG("PluginManager", "ignored file " << fullPath); - break; - } + mFileList.push_back(fullPath); + LOG_DEBUG("PluginManager", "considering " << fullPath); + getAllFilesInPluginPath(fullPath); } closedir(directory); @@ -234,7 +219,6 @@ IPlugin* PluginManager::createDynamicallyLinkedPlugin(std::string path) const char* dlopen_error = dlerror(); if (dlopen_error) { - LOG_DEBUG("PluginManager", "not a shared library: " << dlopen_error); return NULL; } |