You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@locus.apache.org on 2000/07/30 03:58:18 UTC
cvs commit: apache-2.0/src/lib/apr/dso/unix dso.c
trawick 00/07/29 18:58:18
Modified: src/lib/apr/dso/unix dso.c
Log:
ap_dso_sym:
. if using dlsym() to look for the symbol, use dlerror() to store
an error message if dlsym() fails
. slightly increase the chances that the HP-UX code will actually
work by avoiding the reference to retval (compile problem) and
updating *ressym (run-time problem)
Revision Changes Path
1.22 +8 -4 apache-2.0/src/lib/apr/dso/unix/dso.c
Index: dso.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/dso/unix/dso.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- dso.c 2000/07/15 01:07:44 1.21
+++ dso.c 2000/07/30 01:58:18 1.22
@@ -113,10 +113,11 @@
status = shl_findsym((shl_t *)&handle->handle, symname, TYPE_DATA, &symaddr);
if (status = -1)
return APR_EINIT;
- ressym = symaddr;
-
+ *ressym = symaddr;
+ return APR_SUCCESS;
+#else /* not HP-UX; use dlsym()/dlerror() */
-#elif defined(DLSYM_NEEDS_UNDERSCORE)
+#if defined(DLSYM_NEEDS_UNDERSCORE)
void *retval;
char *symbol = (char*)malloc(sizeof(char)*(strlen(symname)+2));
sprintf(symbol, "_%s", symname);
@@ -129,12 +130,15 @@
void *retval = dlsym(handle->handle, symname);
#endif
- if (retval == NULL)
+ if (retval == NULL) {
+ handle->errormsg = dlerror();
return APR_EINIT;
+ }
*ressym = retval;
return APR_SUCCESS;
+#endif /* not HP-UX; use dlsym()/dlerror() */
}
const char *ap_dso_error(ap_dso_handle_t *dso, char *buffer, ap_size_t buflen)