egl: Don't try to load driver basename if the platform needs a suffix
authorKristian Høgsberg <krh@bitplanet.net>
Thu, 13 May 2010 12:27:37 +0000 (08:27 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 13 May 2010 12:28:45 +0000 (08:28 -0400)
That is, don't dlopen(egl_glx) when we know we need to append .so.

src/egl/main/egldriver.c

index 052e611..2864956 100644 (file)
@@ -293,9 +293,9 @@ _eglLoaderFile(const char *dir, size_t len, void *loader_data)
    len += flen;
    path[len] = '\0';
 
-   drv = _eglLoadDriver(path, NULL);
-   /* fix the path and load again */
-   if (!drv && library_suffix()) {
+   if (library_suffix() == NULL || strstr(path, library_suffix()))
+      drv = _eglLoadDriver(path, NULL);
+   else {
       const char *suffix = library_suffix();
       size_t slen = strlen(suffix);
       const char *p;
@@ -306,6 +306,8 @@ _eglLoaderFile(const char *dir, size_t len, void *loader_data)
       if (need_suffix && len + slen + 1 <= sizeof(path)) {
          strcpy(path + len, suffix);
          drv = _eglLoadDriver(path, NULL);
+      } else {
+         drv = NULL;
       }
    }
    if (!drv)