Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/dlfcn.cc4
2 files changed, 8 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 4c0fe3cce..5ea035e4a 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+Sun Jun 3 09:49:55 2001 Robert Collins <rbtcollins@hotmail.com>
+
+ * dlfcn.cc (dlclose): Do not call FreeLibrary if the symbol to close
+ was obtained by dlopen(NULL,...).
+
Sat Jun 2 23:11:52 2001 Christopher Faylor <cgf@cygnus.com>
* syscalls.cc (sleep): Try to be a little more accomodating of signal
diff --git a/winsup/cygwin/dlfcn.cc b/winsup/cygwin/dlfcn.cc
index d1aef528a..39add1dbc 100644
--- a/winsup/cygwin/dlfcn.cc
+++ b/winsup/cygwin/dlfcn.cc
@@ -129,10 +129,12 @@ dlclose (void *handle)
SetResourceLock(LOCK_DLL_LIST,READ_LOCK|WRITE_LOCK," dlclose");
int ret = -1;
- if (FreeLibrary ((HMODULE) handle))
+ void *temphandle = (void *) GetModuleHandle (NULL);
+ if (temphandle == handle || FreeLibrary ((HMODULE) handle))
ret = 0;
if (ret)
set_dl_error ("dlclose");
+ CloseHandle ((HMODULE) temphandle);
ReleaseResourceLock(LOCK_DLL_LIST,READ_LOCK|WRITE_LOCK," dlclose");
return ret;