From c5713f813704153084a31f617e1eb298d2ce7121 Mon Sep 17 00:00:00 2001 From: sangwook lee Date: Mon, 6 Mar 2023 19:06:17 +0900 Subject: [PATCH] Support 64bit plugin Change-Id: Ieb9c51d475ba7d6d5f2f5d78488579798d5becf9 Signed-off-by: sangwook lee --- src/plugin.c | 11 +++++++++-- src/plugin.h | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/plugin.c b/src/plugin.c index 2efe7d2..222e9e3 100755 --- a/src/plugin.c +++ b/src/plugin.c @@ -91,8 +91,15 @@ static int load_plugin_not_default() plugin_init_proc = NULL; plugin_sync_proc = NULL; plugin_async_proc = NULL; + void* void_pointer; + if ((int)(sizeof(void_pointer)) == 8) { + g_plugin_handle = dlopen ( PLUGIN_PATH64, RTLD_NOW ); + } + else { + g_plugin_handle = dlopen ( PLUGIN_PATH, RTLD_NOW ); + } - g_plugin_handle = dlopen ( PLUGIN_PATH, RTLD_NOW ); + //g_plugin_handle = dlopen ( PLUGIN_PATH, RTLD_NOW ); if ( g_plugin_handle == NULL ) { E ( "failed to dlopen(%s). error: %s\n", PLUGIN_PATH, dlerror() ); return 0; @@ -736,4 +743,4 @@ int request_extra_capability_to_plugin (char* out_buf, unsigned int out_len ) } return success; -} \ No newline at end of file +} diff --git a/src/plugin.h b/src/plugin.h index 72345c6..29dfde2 100755 --- a/src/plugin.h +++ b/src/plugin.h @@ -20,6 +20,8 @@ #include "sdbd_plugin.h" #define PLUGIN_PATH "/usr/lib/libsdbd_plugin.so" +#define PLUGIN_PATH64 "/usr/lib64/libsdbd_plugin.so" + #define PLUGIN_XML_PATH "/etc/sdbd/commands.xml" extern char* extcmd; -- 2.34.1