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
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2006-08-11 00:25:54 +0400
committerChristopher Faylor <me@cgf.cx>2006-08-11 00:25:54 +0400
commit1767b8d02834dfbd10c2857f1035c22148856d75 (patch)
tree3a481e3694a7d36e2d6347d32f82e3028cacc75a /winsup
parent2f98d8bdc7a9615d7d473cd808e7482c62bd9e41 (diff)
* 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 b01b31aee..8aed544f1 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2006-08-10 Christopher Faylor <cgf@timesys.com>
+ * pinfo.cc (_onreturn::~onreturn): Don't attempt to close a NULL
+ handle.
+
+2006-08-10 Christopher Faylor <cgf@timesys.com>
+
* winsup.h: Turn on DEBUGGING by default for now.
2006-08-10 Corinna Vinschen <corinna@vinschen.de>
diff --git a/winsup/cygwin/debug.cc b/winsup/cygwin/debug.cc
index 5e92d40a1..bb75b3162 100644
--- a/winsup/cygwin/debug.cc
+++ b/winsup/cygwin/debug.cc
@@ -240,7 +240,7 @@ close_handle (const char *func, int ln, HANDLE h, const char *name, bool force)
#if 1 /* 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, %E\n", name, h, func, ln);
#endif
return ret;
}
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 9440943d8..d73ad20aa 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;}