From: Lee Hyuk Date: Fri, 24 Mar 2017 07:10:41 +0000 (+0900) Subject: Modify the plugin loading path for ARCH64 X-Git-Tag: submit/tizen/20170324.071911 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2Fsubmit%2Ftizen%2F20170324.071911;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git Modify the plugin loading path for ARCH64 Change-Id: I829ba7ab6628faf03d71fd1510f8f8cda3576fe4 Signed-off-by: Lee Hyuk --- diff --git a/bt-service/bt-service-util.c b/bt-service/bt-service-util.c index 460cdb3..7a8f805 100644 --- a/bt-service/bt-service-util.c +++ b/bt-service/bt-service-util.c @@ -154,9 +154,17 @@ void bluetooth_plugin_init() return; } - headed_plugin_info->handle_headed = dlopen(HEADED_PLUGIN_FILEPATH, RTLD_NOW); + /* check ARCH 64 or 32*/ + if (!access(FILEPATH_ARCH_64, 0)) { + BT_INFO("plugin loading for ARCH 64"); + headed_plugin_info->handle_headed = dlopen(HEADED_PLUGIN_FILEPATH64, RTLD_NOW); + } else { + BT_INFO("plugin loading for ARCH 32"); + headed_plugin_info->handle_headed = dlopen(HEADED_PLUGIN_FILEPATH, RTLD_NOW); + } + if (!headed_plugin_info->handle_headed) { - BT_ERR("Can not load %s: %s", HEADED_PLUGIN_FILEPATH, dlerror()); + BT_ERR("Can not load plugin %s", dlerror()); headed_plugin_info->plugin_headed_enabled = FALSE; return; } diff --git a/bt-service/include/bt-service-common.h b/bt-service/include/bt-service-common.h index ba4ce1a..ca4ae48 100644 --- a/bt-service/include/bt-service-common.h +++ b/bt-service/include/bt-service-common.h @@ -259,6 +259,8 @@ extern "C" { #define BT_LE_ADV_SCAN_RSP 0x04 #define HEADED_PLUGIN_FILEPATH "/usr/lib/bt-plugin-headed.so" +#define HEADED_PLUGIN_FILEPATH64 "/usr/lib64/bt-plugin-headed.so" +#define FILEPATH_ARCH_64 "/usr/lib64" /* Profile states matched to btd_service_state_t of bluez service.h */ typedef enum {