aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-08-11 09:02:58 +0000
committerCorinna Vinschen <corinna@vinschen.de>2006-08-11 09:02:58 +0000
commita6d4bb02429216ecbd9a5bd111c3cb98e0cdaa13 (patch)
tree166a5afc41279bcd44a3599bd5431b304a0b55d9 /winsup
parenta452b5e218eeed7f1f9731f12044d8922474a8d5 (diff)
downloadnewlib-a6d4bb02429216ecbd9a5bd111c3cb98e0cdaa13.zip
newlib-a6d4bb02429216ecbd9a5bd111c3cb98e0cdaa13.tar.gz
newlib-a6d4bb02429216ecbd9a5bd111c3cb98e0cdaa13.tar.bz2
* pinfo.cc (_onreturn::~onreturn): Don't attempt to close a NULL
handle.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/debug.cc2
-rw-r--r--winsup/cygwin/pinfo.cc3
3 files changed, 8 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index f77888a..c5ac4fc 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2006-08-10 Christopher Faylor <cgf@timesys.com>
+
+ * pinfo.cc (_onreturn::~onreturn): Don't attempt to close a NULL
+ handle.
+
2006-08-10 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_disk_file::lock): Handle
diff --git a/winsup/cygwin/debug.cc b/winsup/cygwin/debug.cc
index 004ddec..3766352 100644
--- a/winsup/cygwin/debug.cc
+++ b/winsup/cygwin/debug.cc
@@ -238,7 +238,7 @@ close_handle (const char *func, int ln, HANDLE h, const char *name, bool force)
#if 0 /* Uncomment to see CloseHandle failures */
if (!ret)
- small_printf ("CloseHandle(%s) failed %s:%d\n", name, func, ln);
+ small_printf ("CloseHandle(%s) %p failed %s:%d\n", name, h, func, ln);
#endif
return ret;
}
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 9440943..d73ad20 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -1097,10 +1097,11 @@ class _onreturn
public:
~_onreturn ()
{
- if (h)
+ if (h && *h)
{
CloseHandle (*h);
*h = NULL;
+ h = NULL;
}
}
void no_close_p_handle () {h = NULL;}