You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Sander Temme <sc...@covalent.net> on 2001/11/20 08:46:15 UTC

[PATCH] Make DSO work on Darwin

We were not returning the pointer to the module structure that we just
pulled out of the DSO file. No wonder the module structure we tried to use
in mod_so.c:load_module was total garbage! The following patch fixes that
problem.

Index: dso.c
===================================================================
RCS file: /home/cvspublic/apr/dso/unix/dso.c,v
retrieving revision 1.44
diff -u -r1.44 dso.c
--- dso.c       2001/11/13 21:15:33     1.44
+++ dso.c       2001/11/20 07:21:02
@@ -209,6 +209,7 @@
         handle->errormsg = "cannot resolve symbol";
        return APR_EINIT;
     }
+    *ressym = retval;
     return APR_SUCCESS;
 #elif defined(DSO_USE_DLFCN)
 
Enjoy,

Sander

-- 
Covalent Technologies                             sctemme@covalent.net
Engineering group                                Voice: (415) 536 5214
645 Howard St.                                     Fax: (415) 536 5210
San Francisco CA 94105

   PGP Fingerprint: 1E74 4E58 DFAC 2CF5 6A03  5531 AFB1 96AF B584 0AB1

=======================================================
This email message is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited.  If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message
=======================================================


Re: [PATCH] Make DSO work on Darwin

Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Mon, Nov 19, 2001 at 11:46:15PM -0800, Sander Temme wrote:
> We were not returning the pointer to the module structure that we just
> pulled out of the DSO file. No wonder the module structure we tried to use
> in mod_so.c:load_module was total garbage! The following patch fixes that
> problem.

Oh damn.  =)  Works like a charm on moof.  Committed.  Thanks.

Glad we found it.  <cowers under a brown-paper-bag>.  -- justin


Re: [PATCH] Make DSO work on Darwin

Posted by "B. W. Fitzpatrick" <fi...@apple.com>.
One good turn deserves another. I just committed this patch:

   Index: dso.c
   ===================================================================
   RCS file: /home/cvs/apr/dso/unix/dso.c,v
   retrieving revision 1.45
   retrieving revision 1.46
   diff -u -r1.45 -r1.46
   --- dso.c	2001/11/20 08:18:38	1.45
   +++ dso.c	2001/11/20 16:31:25	1.46
   @@ -117,7 +117,7 @@

    #elif defined(DSO_USE_DYLD)
        NSObjectFileImage image;
   -    NSModule os_handle;
   +    NSModule os_handle = NULL;
        char* err_msg = NULL;
        if (NSCreateObjectFileImageFromFile(path, &image) != 
NSObjectFileImageSuccess) {
    	err_msg = "cannot create object file image";


So DSO should be considerably happier on Darwin now. :)

-Fitz


On Tuesday, November 20, 2001, at 01:46  AM, Sander Temme wrote:

> We were not returning the pointer to the module structure that we just
> pulled out of the DSO file. No wonder the module structure we tried to use
> in mod_so.c:load_module was total garbage! The following patch fixes that
> problem.
>
> Index: dso.c
> ===================================================================
> RCS file: /home/cvspublic/apr/dso/unix/dso.c,v
> retrieving revision 1.44
> diff -u -r1.44 dso.c
> --- dso.c       2001/11/13 21:15:33     1.44
> +++ dso.c       2001/11/20 07:21:02
> @@ -209,6 +209,7 @@
>          handle->errormsg = "cannot resolve symbol";
>         return APR_EINIT;
>      }
> +    *ressym = retval;
>      return APR_SUCCESS;
>  #elif defined(DSO_USE_DLFCN)
>
> Enjoy,
>
> Sander