You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ws...@hyperreal.org on 1999/05/04 01:06:06 UTC
cvs commit: apache-1.3/src/os/unix os.c
wsanchez 99/05/03 16:06:06
Modified: src/os/unix os.c
Log:
Use macro "HAVE_DYLD" instead of "RHAPSODY" for dyld-specific code.
Add macro "DYLD_CANT_UNLOAD" around workaround for dyld-unloading-is-a-noop.
Revision Changes Path
1.16 +15 -8 apache-1.3/src/os/unix/os.c
Index: os.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/os/unix/os.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- os.c 1998/09/16 06:49:44 1.15
+++ os.c 1999/05/03 23:06:05 1.16
@@ -26,8 +26,15 @@
* dynamic shared object (DSO) mechanism
*/
-#ifdef RHAPSODY
+#ifdef HAVE_DYLD /* NeXT/Apple dynamic linker */
#include <mach-o/dyld.h>
+
+/*
+ * NSUnlinkModule() is a noop in old versions of dyld.
+ * Let's install an error handler to deal with "multiply defined
+ * symbol" runtime errors.
+ */
+#ifdef DYLD_CANT_UNLOAD
#include "httpd.h"
#include "http_log.h"
@@ -49,7 +56,6 @@
* every time we reload a module. Workaround here is to just
* rebind to the new symbol, and forget about the old one.
* This is crummy, because it's basically a memory leak.
- * (See Radar 2262020 against dyld).
*/
#ifdef DEBUG
@@ -73,11 +79,12 @@
abort();
}
-#endif /*RHAPSODY*/
+#endif /* DYLD_CANT_UNLOAD */
+#endif /* HAVE_DYLD */
void ap_os_dso_init(void)
{
-#if defined(RHAPSODY)
+#if defined(HAVE_DYLD) && defined(DYLD_CANT_UNLOAD)
NSLinkEditErrorHandlers handlers;
handlers.undefined = undefined_symbol_handler;
@@ -95,7 +102,7 @@
handle = shl_load(path, BIND_IMMEDIATE|BIND_VERBOSE|BIND_NOSTART, 0L);
return (void *)handle;
-#elif defined(RHAPSODY)
+#elif defined(HAVE_DYLD)
NSObjectFileImage image;
if (NSCreateObjectFileImageFromFile(path, &image) !=
NSObjectFileImageSuccess)
@@ -116,7 +123,7 @@
#if defined(HPUX) || defined(HPUX10)
shl_unload((shl_t)handle);
-#elif defined(RHAPSODY)
+#elif defined(HAVE_DYLD)
NSUnLinkModule(handle,FALSE);
#else
@@ -138,7 +145,7 @@
status = shl_findsym((shl_t *)&handle, symname, TYPE_DATA, &symaddr);
return (status == -1 ? NULL : symaddr);
-#elif defined(RHAPSODY)
+#elif defined(HAVE_DYLD)
NSSymbol symbol;
char *symname2 = (char*)malloc(sizeof(char)*(strlen(symname)+2));
sprintf(symname2, "_%s", symname);
@@ -163,7 +170,7 @@
{
#if defined(HPUX) || defined(HPUX10)
return strerror(errno);
-#elif defined(RHAPSODY)
+#elif defined(HAVE_DYLD)
return NULL;
#else
return dlerror();