diff options
author | Pavel (Pasha) Shamis <shamisp@ornl.gov> | 2012-02-19 14:18:19 -0600 |
---|---|---|
committer | Gary V. Vaughan <gary@gnu.org> | 2012-10-02 21:03:29 +0700 |
commit | 3467227ccb6c99f4c2122b9fb3fa67d54b5bd54b (patch) | |
tree | d8cdfe63407da48428a6c61b8138e8d681af717a | |
parent | 8bfac9e3e82646868907aede4ebe4deb158a2e8a (diff) | |
download | libtool-3467227ccb6c99f4c2122b9fb3fa67d54b5bd54b.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) |