X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=dlwrap.c;h=858b99b6d5a6b1e41b5b94aad3d4299dcc69fb35;hb=d6ac766abe401b681282cdcf273e7fb67fff99bd;hp=aff9e625eda298680cc890f88061ea1845d97e65;hpb=bf449ac6d282ad726817c4413eb2c310adba2316;p=fips diff --git a/dlwrap.c b/dlwrap.c index aff9e62..858b99b 100644 --- a/dlwrap.c +++ b/dlwrap.c @@ -29,6 +29,8 @@ #include "dlwrap.h" +#include "glwrap.h" + void *libfips_handle; typedef void * (* fips_dlopen_t)(const char * filename, int flag); @@ -86,6 +88,13 @@ dlopen (const char *filename, int flag) if (! find_wrapped_library_index (filename, &index)) return ret; + /* When the application dlopens any wrapped library starting + * with 'libGL', (whether libGL.so.1 or libGLESv2.so.2), let's + * continue to use that library handle for future lookups of + * OpenGL functions. */ + if (STRNCMP_LITERAL (filename, "libGL") == 0) + glwrap_set_gl_handle (ret); + assert (index < ARRAY_SIZE(orig_handles)); orig_handles[index] = ret;