From 4b565b102fd2c005dbccdee1cac1f619ec738254 Mon Sep 17 00:00:00 2001 From: wuqi0105 Date: Tue, 26 Apr 2022 14:18:44 +0800 Subject: [PATCH 1/2] support 64 Signed-off-by: wuqi0105 --- .../devicemanagerservice/src/config/dm_config_manager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/devicemanagerservice/src/config/dm_config_manager.cpp b/services/devicemanagerservice/src/config/dm_config_manager.cpp index 01266edef..117f7cbc5 100644 --- a/services/devicemanagerservice/src/config/dm_config_manager.cpp +++ b/services/devicemanagerservice/src/config/dm_config_manager.cpp @@ -20,7 +20,11 @@ #include "dm_log.h" #include "json_config.h" #include "nlohmann/json.hpp" - +#ifdef __LP64__ +const std::string LIB_LOAD_PATH = "/system/lib64/"; +#else +const std::string LIB_LOAD_PATH = "/system/lib/"; +#endif namespace OHOS { namespace DistributedHardware { void from_json(const nlohmann::json &jsonObject, AdapterSoLoadInfo &soLoadInfo) @@ -85,6 +89,7 @@ DmConfigManager::DmConfigManager() LOGE("adapter json config string exist invalid members"); continue; } + soLoadInfo[i].soPath = LIB_LOAD_PATH; soAdapterLoadInfo_[soLoadInfo[i].soName] = soLoadInfo[i]; LOGI("soAdapterLoadInfo name is: %s", soLoadInfo[i].name.c_str()); LOGI("soAdapterLoadInfo type is: %s", soLoadInfo[i].type.c_str()); @@ -114,6 +119,7 @@ DmConfigManager::DmConfigManager() LOGE("adapter json config string exist invalid members"); continue; } + soLoadInfo[i].soPath = LIB_LOAD_PATH; soAuthLoadInfo_[soLoadInfo[i].authType] = soLoadInfo[i]; LOGI("soAuthLoadInfo name is: %s", soLoadInfo[i].name.c_str()); LOGI("soAuthLoadInfo type is: %s", soLoadInfo[i].type.c_str()); -- Gitee From 8f2cbfdf484633740a4857ee14bbeb53ab9217f2 Mon Sep 17 00:00:00 2001 From: wuqi0105 Date: Tue, 26 Apr 2022 19:21:43 +0800 Subject: [PATCH 2/2] support 64 Signed-off-by: wuqi0105 --- services/devicemanagerservice/src/config/dm_config_manager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/devicemanagerservice/src/config/dm_config_manager.cpp b/services/devicemanagerservice/src/config/dm_config_manager.cpp index 117f7cbc5..364b5e3e8 100644 --- a/services/devicemanagerservice/src/config/dm_config_manager.cpp +++ b/services/devicemanagerservice/src/config/dm_config_manager.cpp @@ -20,11 +20,13 @@ #include "dm_log.h" #include "json_config.h" #include "nlohmann/json.hpp" +namespace { #ifdef __LP64__ const std::string LIB_LOAD_PATH = "/system/lib64/"; #else const std::string LIB_LOAD_PATH = "/system/lib/"; #endif +} namespace OHOS { namespace DistributedHardware { void from_json(const nlohmann::json &jsonObject, AdapterSoLoadInfo &soLoadInfo) -- Gitee