< prev index next >

src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.c

Print this page
rev 14364 : 8156020: 8145547 breaks AIX and and uses RTLD_NOLOAD incorrectly

@@ -28,21 +28,21 @@
 #include "gtk_interface.h"
 
 GtkApi* gtk2_load(JNIEnv *env, const char* lib_name);
 GtkApi* gtk3_load(JNIEnv *env, const char* lib_name);
 
-gboolean gtk2_check(const char* lib_name, int flags);
-gboolean gtk3_check(const char* lib_name, int flags);
+gboolean gtk2_check(const char* lib_name, gboolean load);
+gboolean gtk3_check(const char* lib_name, gboolean load);
 
 GtkApi *gtk;
 
 typedef struct {
     GtkVersion version;
     const char* name;
     const char* vname;
     GtkApi* (*load)(JNIEnv *env, const char* lib_name);
-    gboolean (*check)(const char* lib_name, int flags);
+    gboolean (*check)(const char* lib_name, gboolean load);
 } GtkLib;
 
 static GtkLib libs[] = {
     {
         GTK_2,

@@ -68,14 +68,14 @@
 };
 
 static GtkLib* get_loaded() {
     GtkLib* lib = libs;
     while(!gtk && lib->version) {
-        if (lib->check(lib->vname, RTLD_NOLOAD)) {
+        if (lib->check(lib->vname, /* load = */FALSE)) {
             return lib;
         }
-        if (lib->check(lib->name, RTLD_NOLOAD)) {
+        if (lib->check(lib->name, /* load = */FALSE)) {
             return lib;
         }
         lib++;
     }
     return NULL;

@@ -128,18 +128,18 @@
         }
     }
     return gtk != NULL;
 }
 
-static gboolean check_version(GtkVersion version, int flags) {
+static gboolean check_version(GtkVersion version) {
     GtkLib* lib = libs;
     while (lib->version) {
         if (version == GTK_ANY || lib->version == version) {
-            if (lib->check(lib->vname, flags)) {
+            if (lib->check(lib->vname, /* load = */TRUE)) {
                 return TRUE;
             }
-            if (lib->check(lib->name, flags)) {
+            if (lib->check(lib->name, /* load = */TRUE)) {
                 return TRUE;
             }
         }
         lib++;
     }

@@ -148,11 +148,8 @@
 
 gboolean gtk_check_version(GtkVersion version) {
     if (gtk) {
         return TRUE;
     }
-    if (check_version(version, RTLD_NOLOAD)) {
-        return TRUE;
-    }
-    return check_version(version, RTLD_LAZY | RTLD_LOCAL);
+    return check_version(version);
 }
 
< prev index next >