[Mesa-dev] [PATCH] glx: Don't uselessly dlopen libGL within libGL

Emil Velikov emil.l.velikov at gmail.com
Thu May 29 11:11:49 PDT 2014


On 29/05/14 18:47, Adam Jackson wrote:
> This is entirely pointless.  The DRI driver does not need any symbols
> from libGL, even if it did libGL would already be available to resolve
> them because that's how dlopen works.
> 
FWIW Reviewed-by: Emil Velikov <emil.l.velikov at gmail.com>

-Emil
> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
>  src/glx/dri_common.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c
> index e5a3f70..235d350 100644
> --- a/src/glx/dri_common.c
> +++ b/src/glx/dri_common.c
> @@ -93,14 +93,11 @@ dri_message(int level, const char *f, ...)
>  _X_HIDDEN void *
>  driOpenDriver(const char *driverName)
>  {
> -   void *glhandle, *handle;
> +   void *handle;
>     const char *libPaths, *p, *next;
>     char realDriverName[200];
>     int len;
>  
> -   /* Attempt to make sure libGL symbols will be visible to the driver */
> -   glhandle = dlopen("libGL.so.1", RTLD_NOW | RTLD_LOCAL);
> -
>     libPaths = NULL;
>     if (geteuid() == getuid()) {
>        /* don't allow setuid apps to use LIBGL_DRIVERS_PATH */
> @@ -146,9 +143,6 @@ driOpenDriver(const char *driverName)
>     if (!handle)
>        ErrorMessageF("unable to load driver: %s_dri.so\n", driverName);
>  
> -   if (glhandle)
> -      dlclose(glhandle);
> -
>     return handle;
>  }
>  
> 



More information about the mesa-dev mailing list