PERFORCE change 31854 for review
Dag-Erling Smorgrav
des at FreeBSD.org
Sun May 25 04:42:49 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=31854
Change 31854 by des at des.at.des.thinksec.com on 2003/05/25 04:41:46
Use RTLD_NOW where available, and define it to RTLD_LAZY otherwise.
Affected files ...
.. //depot/projects/openpam/lib/openpam_dynamic.c#12 edit
Differences ...
==== //depot/projects/openpam/lib/openpam_dynamic.c#12 (text+ko) ====
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $P4: //depot/projects/openpam/lib/openpam_dynamic.c#11 $
+ * $P4: //depot/projects/openpam/lib/openpam_dynamic.c#12 $
*/
#include <dlfcn.h>
@@ -43,6 +43,10 @@
#include "openpam_impl.h"
+#ifndef RTLD_NOW
+#define RTLD_NOW RTLD_LAZY
+#endif
+
/*
* OpenPAM internal
*
@@ -64,10 +68,10 @@
/* try versioned module first, then unversioned module */
if (asprintf(&vpath, "%s.%d", path, LIB_MAJ) < 0)
goto buf_err;
- if ((dlh = dlopen(vpath, RTLD_LAZY)) == NULL) {
+ if ((dlh = dlopen(vpath, RTLD_NOW)) == NULL) {
openpam_log(PAM_LOG_DEBUG, "%s: %s", vpath, dlerror());
*strrchr(vpath, '.') = '\0';
- if ((dlh = dlopen(vpath, RTLD_LAZY)) == NULL) {
+ if ((dlh = dlopen(vpath, RTLD_NOW)) == NULL) {
openpam_log(PAM_LOG_DEBUG, "%s: %s", vpath, dlerror());
FREE(module);
return (NULL);
More information about the p4-projects
mailing list