Fix the memset size errors
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / bt-service-util.c
index 460cdb3..7878d77 100644 (file)
@@ -38,7 +38,7 @@ bt_plugin_info_t *headed_plugin_info = NULL;
 void _bt_init_request_id(void)
 {
        assigned_id = 0;
-       memset(req_id_used, 0x00, BT_REQUEST_ID_RANGE_MAX);
+       memset(req_id_used, 0x00, sizeof(req_id_used));
 }
 
 int _bt_assign_request_id(void)
@@ -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;
        }