OSDN Git Service

* pinfo.cc (_onreturn::~onreturn): Don't attempt to close a NULL handle.
authorcgf <cgf>
Thu, 10 Aug 2006 20:25:54 +0000 (20:25 +0000)
committercgf <cgf>
Thu, 10 Aug 2006 20:25:54 +0000 (20:25 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/debug.cc
winsup/cygwin/pinfo.cc

index b01b31a..8aed544 100644 (file)
@@ -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>
index 5e92d40..bb75b31 100644 (file)
@@ -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;
 }
index 9440943..d73ad20 100644 (file)
@@ -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;}