summaryrefslogtreecommitdiff
path: root/dso
diff options
context:
space:
mode:
authorJustin Erenkrantz <jerenkrantz@apache.org>2002-06-24 07:01:19 +0000
committerJustin Erenkrantz <jerenkrantz@apache.org>2002-06-24 07:01:19 +0000
commit6768ef5becaf51f482251066d231e6c71fb0412c (patch)
treec6cc7be7f2f40522eba235ca019f4d8f8da4e9fb /dso
parentea6d7ab6e44189f6ab51218fe1963a7ea6eced9e (diff)
downloadapr-6768ef5becaf51f482251066d231e6c71fb0412c.tar.gz
Correct shared library support on Darwin to not fatally error out when
a shared library does not exist. This does retain the Mach-O bundle and Mach-O dynamically linked shared library support on Darwin. Also improvements relating to testdso: - Get testdso to actually link. - Add support for a second DSO to load in testdso. - Build mod_test.slo and libmod_test.slo with and without the -module option. This checks that both types of dynamic libraries can be loaded. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63521 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'dso')
-rw-r--r--dso/unix/dso.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/dso/unix/dso.c b/dso/unix/dso.c
index a6d3860e2..8f97b7555 100644
--- a/dso/unix/dso.c
+++ b/dso/unix/dso.c
@@ -124,8 +124,11 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle,
#elif defined(DSO_USE_DYLD)
NSObjectFileImage image;
NSModule os_handle = NULL;
+ NSObjectFileImageReturnCode dsoerr;
char* err_msg = NULL;
- if (NSCreateObjectFileImageFromFile(path, &image) == NSObjectFileImageSuccess) {
+ dsoerr = NSCreateObjectFileImageFromFile(path, &image);
+
+ if (dsoerr == NSObjectFileImageSuccess) {
#if defined(NSLINKMODULE_OPTION_RETURN_ON_ERROR) && defined(NSLINKMODULE_OPTION_NONE)
os_handle = NSLinkModule(image, path,
NSLINKMODULE_OPTION_RETURN_ON_ERROR |
@@ -135,7 +138,9 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle,
#endif
NSDestroyObjectFileImage(image);
}
- else if (NSAddLibrary(path) == TRUE) {
+ else if ((dsoerr == NSObjectFileImageFormat ||
+ dsoerr == NSObjectFileImageInappropriateFile) &&
+ NSAddLibrary(path) == TRUE) {
os_handle = (NSModule)DYLD_LIBRARY_HANDLE;
}
else {