This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: another patch for dlopen [was Re: dlopen bug!]
- To: Geoffrey Noer <noer at cygnus dot com>, Jorrit Tyberghein <Jorrit dot Tyberghein at uz dot kuleuven dot ac dot be>, gnu-win32 at cygnus dot com
- Subject: Re: another patch for dlopen [was Re: dlopen bug!]
- From: "Gary V. Vaughan" <gvaughan at oranda dot demon dot co dot uk>
- Date: Wed, 11 Nov 1998 13:19:57 +0000
- Organization: Aethos Communication Systems ltd.
- References: <36481BE9.35E38846@uz.kuleuven.ac.be> <36498DA3.72173F70@oranda.demon.co.uk>
"Gary V. Vaughan" wrote:
>
> A fix is attached. This is in addition to the previous patch (and
> the patch from Christian Jullien).
>
> I forgot to post a ChangeLog entry yesterday, so I have included both
> here, and another for Christian's dlsym patch which is attached too.
Oops! It seems I posted Christian's patch directly, which isn't quite
right... the real one is attached below.
Cheers,
Gary.
--- dlfcn.cc.orig Tue Nov 10 11:58:45 1998
+++ dlfcn.cc Wed Nov 11 13:15:54 1998
@@ -139,7 +153,12 @@ dlopen (const char *name, int)
void *
dlsym (void *handle, const char *name)
{
- void *ret = (void *) GetProcAddress (handle, name);
+ void * ret = 0;
+
+ if( handle )
+ ret = (void *) GetProcAddress (handle, name);
+ else ret = (void *) GetProcAddress (GetModuleHandle(0), name);
+
if (!ret)
set_dl_error ("dlsym");
debug_printf ("ret %p", ret);