From 42aa06a575402b64d1d3657863f67f9bc74417be Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 5 Apr 2005 17:13:35 +0000 Subject: [PATCH] * cygtls.cc (_cygtls::remove): Don't free or close stuff if we're being called in a "non-standard" way. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/cygtls.cc | 21 ++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 0e1a78eea..e3f1104b3 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2005-04-05 Christopher Faylor + + * cygtls.cc (_cygtls::remove): Don't free or close stuff if we're being + called in a "non-standard" way. + 2005-04-05 Christopher Faylor * sync.h (muto::initforce): Delete flawed implementation. diff --git a/winsup/cygwin/cygtls.cc b/winsup/cygwin/cygtls.cc index b4ca01b44..7b8c560ce 100644 --- a/winsup/cygwin/cygtls.cc +++ b/winsup/cygwin/cygtls.cc @@ -165,15 +165,18 @@ _cygtls::remove (DWORD wait) debug_printf ("wait %p", wait); if (!locals.exitsock) return; - // FIXME: Need some sort of atthreadexit function to allow things like - // select to control this themselves - if (locals.exitsock != INVALID_SOCKET) - closesocket (locals.exitsock); - free_local (process_ident); - free_local (ntoa_buf); - free_local (protoent_buf); - free_local (servent_buf); - free_local (hostent_buf); + if (wait) + { + // FIXME: Need some sort of atthreadexit function to allow things like + // select to control this themselves + if (locals.exitsock != INVALID_SOCKET) + closesocket (locals.exitsock); + free_local (process_ident); + free_local (ntoa_buf); + free_local (protoent_buf); + free_local (servent_buf); + free_local (hostent_buf); + } do { -- 2.43.5