jerenkrantz 2002/09/12 21:59:52
Modified: . CHANGES
dso/unix dso.c
Log:
When encountering a link error when loading a DSO on Darwin, print the error.
Revision Changes Path
1.333 +2 -0 apr/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/apr/CHANGES,v
retrieving revision 1.332
retrieving revision 1.333
diff -u -u -r1.332 -r1.333
--- CHANGES 12 Sep 2002 00:50:21 -0000 1.332
+++ CHANGES 13 Sep 2002 04:59:52 -0000 1.333
@@ -1,5 +1,7 @@
Changes with APR 0.9.2
+ *) Print informative link errors on Darwin. [Justin Erenkrantz]
+
Changes with APR 0.9.1
*) Fixed usage of alloca in apr_poll() on Tru64
1.56 +8 -1 apr/dso/unix/dso.c
Index: dso.c
===================================================================
RCS file: /home/cvs/apr/dso/unix/dso.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -u -r1.55 -r1.56
--- dso.c 24 Jun 2002 07:01:18 -0000 1.55
+++ dso.c 13 Sep 2002 04:59:52 -0000 1.56
@@ -125,7 +125,7 @@
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 @@
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