summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2011-04-03 06:48:45 +0000
committerKen Raeburn <raeburn@mit.edu>2011-04-03 06:48:45 +0000
commit6eaebb7766424f68d55d514dc2cc51c11c968e5e (patch)
treeaea290c62cdc00f412378fc376b66e5139cb1c91 /src
parent21cde9c531197cffbd15b8bdc3dd75a97f0601ed (diff)
downloadkrb5-6eaebb7766424f68d55d514dc2cc51c11c968e5e.tar.gz
krb5-6eaebb7766424f68d55d514dc2cc51c11c968e5e.tar.xz
krb5-6eaebb7766424f68d55d514dc2cc51c11c968e5e.zip
Only use RTLD_NODELETE if it's available
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24815 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/util/support/plugins.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/util/support/plugins.c b/src/util/support/plugins.c
index ce65e1bca1..96b9d948d7 100644
--- a/src/util/support/plugins.c
+++ b/src/util/support/plugins.c
@@ -258,12 +258,20 @@ krb5int_open_plugin (const char *filepath, struct plugin_file_handle **h, struct
#endif /* USE_CFBUNDLE */
#ifdef RTLD_GROUP
-#define PLUGIN_DLOPEN_FLAGS (RTLD_NOW | RTLD_LOCAL | RTLD_GROUP)
+# ifdef RTLD_NODELETE
+# define PLUGIN_DLOPEN_FLAGS (RTLD_NOW | RTLD_LOCAL | RTLD_GROUP | RTLD_NODELETE)
+# else
+# define PLUGIN_DLOPEN_FLAGS (RTLD_NOW | RTLD_LOCAL | RTLD_GROUP)
+# endif
#else
-#define PLUGIN_DLOPEN_FLAGS (RTLD_NOW | RTLD_LOCAL)
+# ifdef RTLD_NODELETE
+# define PLUGIN_DLOPEN_FLAGS (RTLD_NOW | RTLD_LOCAL | RTLD_NODELETE)
+# else
+# define PLUGIN_DLOPEN_FLAGS (RTLD_NOW | RTLD_LOCAL)
+# endif
#endif
if (!err) {
- handle = dlopen(filepath, PLUGIN_DLOPEN_FLAGS | RTLD_NODELETE);
+ handle = dlopen(filepath, PLUGIN_DLOPEN_FLAGS);
if (handle == NULL) {
const char *e = dlerror();
if (e == NULL)