From: Pavel (Pasha) Shamis Date: Sun, 19 Feb 2012 20:18:19 +0000 (-0600) Subject: Improve debug error reporting in ltdl. X-Git-Tag: v2.4.2.418~197 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e444159cc04dc6721d509d9d3d6ba0bc6f9e5048;p=thirdparty%2Flibtool.git Improve debug error reporting in ltdl. * libltdl/ltdl.c: Print the error message if loading fails. --- 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)