diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2011-04-18 20:53:03 +0000 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2011-04-18 20:53:03 +0000 |
commit | cf80cd165ee72c925f2d6913636f82496813484e (patch) | |
tree | fccb385390515c710e98690914bc145cbdc01a4a | |
parent | 80ae75fba0acda3bbc4dae86b7f46c0fa8079e84 (diff) |
support systems without RTLD_NODELETE
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1429 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r-- | nslcd/nslcd.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/nslcd/nslcd.c b/nslcd/nslcd.c index d19c906..f34b50c 100644 --- a/nslcd/nslcd.c +++ b/nslcd/nslcd.c @@ -611,7 +611,11 @@ static void disable_nss_ldap(void) char *error; int *enable_flag; /* try to load the NSS module */ +#ifdef RTLD_NODELETE handle=dlopen(NSS_LDAP_SONAME,RTLD_LAZY|RTLD_NODELETE); +#else /* not RTLD_NODELETE */ + handle=dlopen(NSS_LDAP_SONAME,RTLD_LAZY|RTLD_NODELETE); +#endif /* RTLD_NODELETE */ if (handle==NULL) { log_log(LOG_WARNING,"Warning: LDAP NSS module not loaded: %s",dlerror()); @@ -635,8 +639,10 @@ static void disable_nss_ldap(void) } /* disable nss_ldap */ *enable_flag=0; - /* close the handle */ +#ifdef RTLD_NODELETE + /* only close the handle if RTLD_NODELETE was used */ dlclose(handle); +#endif /* RTLD_NODELETE */ } /* the main program... */ |