]> git.cworth.org Git - glaze/commitdiff
Add a more useful error message if dlopen fails
authorCarl Worth <cworth@cworth.org>
Thu, 22 Aug 2013 00:32:35 +0000 (17:32 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 22 Aug 2013 00:32:35 +0000 (17:32 -0700)
Previously, we were printing only the name of the library that we failed to
open. Now, we also print the underlying cause for the failure, (as reported
by dlerror).

glaze-gl.c

index 0c2eada8d458ea1ca672a1e9a90df365032909ce..b6e7d72d3f8f9317a4ae03136f73b1ff9f444fa7 100644 (file)
@@ -63,9 +63,11 @@ open_wrapper_handle (void)
                exit (1);
        }
 
+       dlerror ();
        wrapper_handle = dlopen (path, RTLD_LAZY);
        if (wrapper_handle == NULL) {
-               fprintf (stderr, "Error: Failed to dlopen %s\n", path);
+               const char *error = dlerror();
+               fprintf (stderr, "Error: Failed to dlopen %s: %s\n", path, error);
                exit (1);
        }
 }