You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@locus.apache.org on 2000/05/26 18:24:12 UTC
cvs commit: apache-2.0/src/lib/apr/test testdso.c
rbb 00/05/26 09:24:12
Modified: src/lib/apr/dso/unix dso.c
src/lib/apr/misc/unix errorcodes.c
src/lib/apr/test testdso.c
Log:
Fix error handling for DSO opening. This probably doesn't fix all
of the dso error handling, but it reports errors when opening with
much more detail.
Revision Changes Path
1.13 +4 -0 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.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- dso.c 2000/04/14 15:58:20 1.12
+++ dso.c 2000/05/26 16:24:07 1.13
@@ -71,7 +71,11 @@
#endif
if(os_handle == NULL)
+#if defined(HPUX) || defined(HPUX10) || defined(HPUX11)
+ return errno;
+#else
return APR_EDSOOPEN;
+#endif
*res_handle = ap_pcalloc(ctx, sizeof(*res_handle));
(*res_handle)->handle = (void*)os_handle;
1.15 +4 -1 apache-2.0/src/lib/apr/misc/unix/errorcodes.c
Index: errorcodes.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/misc/unix/errorcodes.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- errorcodes.c 2000/05/17 22:30:49 1.14
+++ errorcodes.c 2000/05/26 16:24:08 1.15
@@ -57,6 +57,9 @@
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
+#ifdef HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
/*
* stuffbuffer - like ap_cpystrn() but returns the address of the
@@ -98,7 +101,7 @@
case APR_ENOSHMAVAIL:
return "No shared memory is currently available";
case APR_EDSOOPEN:
- return "Could not open the dso.";
+ return dlerror();
case APR_INCHILD:
return
"Your code just forked, and you are currently executing in the "
1.5 +5 -2 apache-2.0/src/lib/apr/test/testdso.c
Index: testdso.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/test/testdso.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- testdso.c 2000/04/22 05:09:34 1.4
+++ testdso.c 2000/05/26 16:24:10 1.5
@@ -12,6 +12,7 @@
ap_dso_handle_t *h = NULL;
ap_dso_handle_sym_t func1 = NULL;
ap_dso_handle_sym_t func2 = NULL;
+ ap_status_t status;
ap_pool_t *cont;
void (*function)(void);
void (*function1)(int);
@@ -38,8 +39,10 @@
fprintf(stdout,"OK\n");
fprintf(stdout,"Trying to load DSO now.....................");
fflush(stdout);
- if (ap_dso_load(&h, filename, cont) != APR_SUCCESS){
- fprintf(stderr, "Failed to load %s!\n", filename);
+ if ((status = ap_dso_load(&h, filename, cont)) != APR_SUCCESS){
+ char my_error[256];
+ ap_strerror(status, my_error, sizeof(my_error));
+ fprintf(stderr, "%s!\n", my_error);
exit (-1);
}
fprintf(stdout,"OK\n");