diff options
author | Pavel (Pasha) Shamis <shamisp@ornl.gov> | 2012-02-19 14:18:19 -0600 |
---|---|---|
committer | Peter O'Gorman <peter@pogma.com> | 2012-02-19 14:18:19 -0600 |
commit | e444159cc04dc6721d509d9d3d6ba0bc6f9e5048 (patch) | |
tree | 92c76f5d16cf9fb280ed9909a49d2378300c5000 | |
parent | b2ccf68b01d3e6092e2b505386c50486b71e7dd6 (diff) | |
download | libtool-e444159cc04dc6721d509d9d3d6ba0bc6f9e5048.tar.gz |
Improve debug error reporting in ltdl.
* libltdl/ltdl.c: Print the error message if loading fails.
-rw-r--r-- | libltdl/ltdl.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index fba276c2..7f94696d 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) |