From: Carl Worth Date: Thu, 30 May 2013 19:55:26 +0000 (-0700) Subject: dlwrap: Fix dlwrap_real_dlopen to only perform dlsym-lookup once X-Git-Url: https://git.cworth.org/git?p=fips;a=commitdiff_plain;h=ad04f4e5a300b08cd7356d15725d84d34f152a07 dlwrap: Fix dlwrap_real_dlopen to only perform dlsym-lookup once Making the real_dlopen variable static means that we perform the dlysm lookup only once and then re-use the result for later calls. This is what was always intended for this code. --- diff --git a/dlwrap.c b/dlwrap.c index 0c57f75..aac06f6 100644 --- a/dlwrap.c +++ b/dlwrap.c @@ -62,7 +62,7 @@ dlopen (const char *filename, int flag) void * dlwrap_real_dlopen (const char *filename, int flag) { - fips_dlopen_t real_dlopen = NULL; + static fips_dlopen_t real_dlopen = NULL; if (! real_dlopen) { real_dlopen = (fips_dlopen_t) dlwrap_real_dlsym (RTLD_NEXT, "dlopen");