trawick     01/04/02 12:33:15

  Modified:    .        CHANGES configure.in
               dso/aix  dso.c Makefile.in
               include/arch/aix dso.h
  Log:
  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)
  
  Revision  Changes    Path
  1.81      +4 -0      apr/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apr/CHANGES,v
  retrieving revision 1.80
  retrieving revision 1.81
  diff -u -r1.80 -r1.81
  --- CHANGES   2001/04/02 19:01:09     1.80
  +++ CHANGES   2001/04/02 19:32:54     1.81
  @@ -1,5 +1,9 @@
   Changes with APR b1  
   
  +  *) Use the dso/aix subdirectory for older versions of AIX and fix 
  +     a number of bugs in the dso code in that directory.
  +     [Victor Orlikowski]
  +
     *) Allow libtool 1.3b to be used.  [Victor Orlikowski]
   
     *) Misc. Win32 fixes: Set the pool pointer in apr_sockaddr_t 
  
  
  
  1.268     +6 -0      apr/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/apr/configure.in,v
  retrieving revision 1.267
  retrieving revision 1.268
  diff -u -r1.267 -r1.268
  --- configure.in      2001/03/31 06:20:00     1.267
  +++ configure.in      2001/04/02 19:32:56     1.268
  @@ -120,6 +120,12 @@
   esac
   
   case "$OS" in
  +   i386-ibm-aix* | *-ibm-aix[1-2].* | *-ibm-aix3.* | *-ibm-aix4.1 | 
*-ibm-aix4.1.* | *-ibm-aix4.2 | *-ibm-aix4.2.*)
  +       OSDIR="aix"
  +       config_subdirs="shmem/unix/mm"
  +       USE_MM=yes
  +       eolstr="\\n"
  +       ;;
      *-os2*)
          CFLAGS="$CFLAGS -DOS2 -Zmt"
          OSDIR="os2"
  
  
  
  1.14      +18 -5     apr/dso/aix/dso.c
  
  Index: dso.c
  ===================================================================
  RCS file: /home/cvs/apr/dso/aix/dso.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- dso.c     2001/02/16 04:15:32     1.13
  +++ dso.c     2001/04/02 19:33:03     1.14
  @@ -148,8 +148,10 @@
   {
       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 @@
   {
       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 @@
        * 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++;
  
  
  
  1.8       +3 -1      apr/dso/aix/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/apr/dso/aix/Makefile.in,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Makefile.in       2001/01/09 11:05:37     1.7
  +++ Makefile.in       2001/04/02 19:33:05     1.8
  @@ -5,6 +5,8 @@
   @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
  
  
  
  1.8       +1 -0      apr/include/arch/aix/dso.h
  
  Index: dso.h
  ===================================================================
  RCS file: /home/cvs/apr/include/arch/aix/dso.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- dso.h     2001/02/16 04:15:49     1.7
  +++ dso.h     2001/04/02 19:33:12     1.8
  @@ -71,6 +71,7 @@
   struct apr_dso_handle_t {
       apr_pool_t  *cont;
       void          *handle;
  +    const char *errormsg;
   };
   
   #endif
  
  
  

Reply via email to