From 23272b90cf5585232b919426031530d064b6620a Mon Sep 17 00:00:00 2001 From: jerenkrantz Date: Fri, 13 Sep 2002 04:59:52 +0000 Subject: When encountering a link error when loading a DSO on Darwin, print the error. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63863 13f79535-47bb-0310-9956-ffa450edef68 --- dso/unix/dso.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'dso') diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 8f97b7555..9168920fd 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -125,7 +125,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, NSObjectFileImage image; NSModule os_handle = NULL; NSObjectFileImageReturnCode dsoerr; - char* err_msg = NULL; + const char* err_msg = NULL; dsoerr = NSCreateObjectFileImageFromFile(path, &image); if (dsoerr == NSObjectFileImageSuccess) { @@ -133,6 +133,13 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, os_handle = NSLinkModule(image, path, NSLINKMODULE_OPTION_RETURN_ON_ERROR | NSLINKMODULE_OPTION_NONE); + /* If something went wrong, get the errors... */ + if (!os_handle) { + NSLinkEditErrors errors; + int errorNumber; + const char *fileName; + NSLinkEditError(&errors, &errorNumber, &fileName, &err_msg); + } #else os_handle = NSLinkModule(image, path, FALSE); #endif -- cgit v1.2.1