Make a description of ${cpu} variable not so confusing.
[monky] / src / xmms.c
index 8a00424..c992e2c 100644 (file)
@@ -210,7 +210,7 @@ void *xmms_thread_func_dynamic(void *pvoid)
     glib_v1_2_handle=NULL;
     g_free_v1_2=NULL;
 
-    /* Conky likely be linked to libglib-2.0.so and not libglib-1.2.so.0.  If conky is receiving
+    /* Conky will likely be linked to libglib-2.0.so and not libglib-1.2.so.0.  If conky is receiving
      * gchar * data from xmms, these strings need to be freed using g_free() from libglib-1.2.so.0.
      * This macro selects the g_free() from the correct library. */
     #define G_FREE(mem) (info.xmms.current_project==PROJECT_XMMS ? (*g_free_v1_2)(mem) : g_free(mem))
@@ -218,9 +218,14 @@ void *xmms_thread_func_dynamic(void *pvoid)
     switch(info.xmms.current_project) {
 
     case (PROJECT_XMMS) :
-           glib_v1_2_handle = dlopen("libglib-1.2.so.0", RTLD_LAZY);
-           if (!glib_v1_2_handle) {
-               ERR("unable to open libglib-1.2.so");
+           /* make an effort to find the glib 1.2 shared lib */
+           if ( ((glib_v1_2_handle = dlopen("libglib-1.2.so.0", RTLD_LAZY))==NULL) &&
+                ((glib_v1_2_handle = dlopen("libglib-12.so.0", RTLD_LAZY))==NULL) &&
+                ((glib_v1_2_handle = dlopen("libglib-12.so", RTLD_LAZY))==NULL) &&
+                ((glib_v1_2_handle = dlopen("libglib12.so", RTLD_LAZY))==NULL) &&
+                ((glib_v1_2_handle = dlopen("libglib.so", RTLD_LAZY))==NULL) )
+           {
+               ERR("unable to find glib 1.2 shared object lib!");
                pthread_exit(NULL);
            }
            g_free_v1_2=dlsym(glib_v1_2_handle, "g_free");