From 6eaebb7766424f68d55d514dc2cc51c11c968e5e Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Sun, 3 Apr 2011 06:48:45 +0000 Subject: [PATCH] Only use RTLD_NODELETE if it's available git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24815 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/support/plugins.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/util/support/plugins.c b/src/util/support/plugins.c index ce65e1bca..96b9d948d 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) -- 2.26.2