diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index b1632977c..9958a3ffb 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2011-04-18 Corinna Vinschen + + * cygtls.cc (_cygtls::remove): Always close sockevt handle. + 2011-04-18 Corinna Vinschen * cygwin.din (ppoll): Export. diff --git a/winsup/cygwin/cygtls.cc b/winsup/cygwin/cygtls.cc index d61ea4dc7..026d4c837 100644 --- a/winsup/cygwin/cygtls.cc +++ b/winsup/cygwin/cygtls.cc @@ -146,13 +146,14 @@ _cygtls::remove (DWORD wait) return; debug_printf ("wait %p", wait); + if (locals.select.sockevt) + CloseHandle (locals.select.sockevt); if (wait) { /* FIXME: Need some sort of atthreadexit function to allow things like select to control this themselves. */ if (locals.select.sockevt) { - CloseHandle (locals.select.sockevt); locals.select.sockevt = NULL; free_local (select.ser_num); free_local (select.w4);