From 3467227ccb6c99f4c2122b9fb3fa67d54b5bd54b Mon Sep 17 00:00:00 2001 From: "Pavel (Pasha) Shamis" Date: Sun, 19 Feb 2012 14:18:19 -0600 Subject: [PATCH] Improve debug error reporting in ltdl. * libltdl/ltdl.c: Print the error message if loading fails. --- libltdl/ltdl.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index fba276c24..7f94696de 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -444,8 +444,15 @@ tryall_dlopen (lt_dlhandle *phandle, const char *filename, handle->module = (*loader_vtable->module_open) (loader_vtable->dlloader_data, filename, advise); #ifdef LT_DEBUG_LOADERS - fprintf (stderr, " Result: %s\n", - handle->module ? "Success" : "Failed"); + if (!handle->module) { + char *error; + LT__GETERROR(error); + fprintf (stderr, " Result: Failed\n" + " Error message << %s >>\n", + error ? error : "(null)"); + } else { + fprintf (stderr, " Result: Success\n"); + } #endif if (handle->module != 0) -- 2.47.2