diff options
author | Haru <haru@dotalux.com> | 2013-08-30 14:43:36 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2013-08-30 14:43:36 +0200 |
commit | 51b7f5c6f6af53c3fc6a71ede9aea6b760a91491 (patch) | |
tree | a323c7519c5e832c4a8531b6aade251745f3edbe /src | |
parent | 9bfc9884a7df6f65d6cedf7b35897cfffb6dec45 (diff) | |
download | hercules-51b7f5c6f6af53c3fc6a71ede9aea6b760a91491.tar.gz hercules-51b7f5c6f6af53c3fc6a71ede9aea6b760a91491.tar.bz2 hercules-51b7f5c6f6af53c3fc6a71ede9aea6b760a91491.tar.xz hercules-51b7f5c6f6af53c3fc6a71ede9aea6b760a91491.zip |
Changed dlopen to use RTLD_DEEPBIND where available
- Fixes bugreport:7680
http://hercules.ws/board/tracker/issue-7680-hpm-is-broken/
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/common/HPM.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/common/HPM.h b/src/common/HPM.h index d2a1308f2..614498fd3 100644 --- a/src/common/HPM.h +++ b/src/common/HPM.h @@ -18,9 +18,13 @@ #define DLL_EXT ".dll" #define DLL HINSTANCE -#else +#else // ! WIN32 #include <dlfcn.h> - #define plugin_open(x) dlopen(x,RTLD_NOW) + #ifdef RTLD_DEEPBIND // Certain linux ditributions require this, but it's not available everywhere + #define plugin_open(x) dlopen(x,RTLD_NOW|RTLD_DEEPBIND) + #else // ! RTLD_DEEPBIND + #define plugin_open(x) dlopen(x,RTLD_NOW) + #endif // RTLD_DEEPBIND #define plugin_import(x,y,z) (z)dlsym(x,y) #define plugin_close(x) dlclose(x) @@ -34,7 +38,7 @@ #include <string.h> // size_t -#endif +#endif // WIN32 struct hplugin { DLL dll; |