httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug MacEachern <do...@covalent.net>
Subject 2.0 mod_so + dlerror()
Date Fri, 26 May 2000 15:11:10 GMT
with the current cvs version dlerror() is not called for dso failures:
Syntax error on line 3 of /home/dougm/apache-2.0/conf/httpd.conf:
Cannot load /home/dougm/apache-2.0/libexec/libmodperl.so into server:
Could not open the dso.

with the patch below, i get a more useful message:
Syntax error on line 3 of /home/dougm/apache-2.0/conf/httpd.conf:
Cannot load /home/dougm/apache-2.0/libexec/libmodperl.so into server:
/home/dougm/apache-2.0/libexec/libmodperl.so: undefined symbol:
modperl_tipool_destroy

let me know if i'm on the right track here and i will lift the rest of the
ap_os_dso_error code from 1.3 into apr

Index: lib/apr/dso/unix/dso.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/dso/unix/dso.c,v
retrieving revision 1.12
diff -u -u -r1.12 dso.c
--- lib/apr/dso/unix/dso.c	2000/04/14 15:58:20	1.12
+++ lib/apr/dso/unix/dso.c	2000/05/26 14:45:48
@@ -129,3 +129,15 @@
     
     return APR_SUCCESS;
 }
+
+const char *ap_dso_error(void)
+{
+#if defined(HPUX) || defined(HPUX10) || defined(HPUX11)
+        char my_error[256];
+        return ap_strerror(status, my_error, sizeof(my_error));
+#elif defined(HAVE_DYLD)
+    return NULL;
+#else
+    return dlerror();
+#endif
+}
Index: lib/apr/include/apr_dso.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_dso.h,v
retrieving revision 1.9
diff -u -u -r1.9 apr_dso.h
--- lib/apr/include/apr_dso.h	2000/04/16 04:46:53	1.9
+++ lib/apr/include/apr_dso.h	2000/05/26 14:45:51
@@ -116,6 +116,17 @@
  */
 ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym, ap_dso_handle_t *handle, 
                        const char *symname);
+
+/*
+
+=head1 const char *ap_dso_error(void)
+
+B<Return the string error for dso failures>
+
+=cut
+ */
+const char *ap_dso_error(void);
+
 #ifdef __cplusplus
 }
 #endif
Index: modules/standard/mod_so.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_so.c,v
retrieving revision 1.18
diff -u -u -r1.18 mod_so.c
--- modules/standard/mod_so.c	2000/05/16 02:57:00	1.18
+++ modules/standard/mod_so.c	2000/05/26 14:46:02
@@ -255,11 +255,9 @@
      * Load the file into the Apache address space
      */
     if ((status = ap_dso_load(&modhandle, szModuleFile, cmd->pool )) != APR_SUCCESS)
{
-        char my_error[256];
-
         return ap_pstrcat(cmd->pool, "Cannot load ", szModuleFile,
 			  " into server: ",
-			  ap_strerror(status, my_error, sizeof(my_error)),
+                          ap_dso_error(),
 			  NULL);
     }
     ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, NULL,



Mime
View raw message