summaryrefslogtreecommitdiff
path: root/dso/aix
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2001-04-02 19:33:12 +0000
committerJeff Trawick <trawick@apache.org>2001-04-02 19:33:12 +0000
commitc812d2219ea43e30e96b746aa5cfd596a306c0b4 (patch)
treeb78c78993e8c988ab38b2c91e8a183df11141805 /dso/aix
parent7fe6791d6ab892b7b40930b81cb1619dc403b7a4 (diff)
downloadapr-c812d2219ea43e30e96b746aa5cfd596a306c0b4.tar.gz
This patch sets the dso/aix subdirectory to be used for older versions
of AIX and fixes a number of bugs the dso code in that directory. Submitted by: Victor Orlikowski Reviewed by: Jeff Trawick (any build problems are my bad... I changed Victor's patch to avoid the 'include "../unix/apr_private.h"' kludge but am not able to easily test) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61429 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'dso/aix')
-rw-r--r--dso/aix/Makefile.in4
-rw-r--r--dso/aix/dso.c23
2 files changed, 21 insertions, 6 deletions
diff --git a/dso/aix/Makefile.in b/dso/aix/Makefile.in
index 1fed55114..fe018d7d4 100644
--- a/dso/aix/Makefile.in
+++ b/dso/aix/Makefile.in
@@ -5,6 +5,8 @@ TARGETS = dso.lo
@INCLUDE_RULES@
INCDIR=../../include
-INCLUDES=-I$(INCDIR) -I$(INCDIR)/arch
+OSDIR=$(INCDIR)/arch/@OSDIR@
+DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
+INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
# DO NOT REMOVE
diff --git a/dso/aix/dso.c b/dso/aix/dso.c
index 4ceb9415c..1ddd42d0c 100644
--- a/dso/aix/dso.c
+++ b/dso/aix/dso.c
@@ -148,8 +148,10 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle,
{
void *os_handle = dlopen((char *)path, RTLD_NOW | RTLD_GLOBAL);
- if(os_handle == NULL)
+ if(os_handle == NULL) {
+ (*res_handle)->errormsg = dlerror();
return APR_EDSOOPEN;
+ }
*res_handle = apr_pcalloc(ctx, sizeof(*res_handle));
(*res_handle)->handle = (void*)os_handle;
@@ -171,13 +173,24 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym,
{
void *retval = dlsym(handle->handle, symname);
- if (retval == NULL)
+ if (retval == NULL) {
+ handle->errormsg = dlerror();
return APR_EINIT;
-
- ressym = retval;
+ }
+
+ *ressym = retval;
return APR_SUCCESS;
}
+APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buffer, apr_size_t buflen)
+{
+ if (dso->errormsg) {
+ apr_cpystrn(buffer, dso->errormsg, buflen);
+ return dso->errormsg;
+ }
+ return "No Error";
+}
+
/*
@@ -282,7 +295,7 @@ void *dlopen(const char *path, int mode)
* load should be declared load(const char *...). Thus we
* cast the path to a normal char *. Ugly.
*/
- if ((mp->entry = (void *) load((char *) path, L_NOAUTODEFER, NULL)) == NULL) {
+ if ((mp->entry = (void *) loadAndInit((char *) path, L_NOAUTODEFER, NULL)) == NULL) {
free(mp->name);
free(mp);
errvalid++;