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
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-04-05 21:13:35 +0400
committerChristopher Faylor <me@cgf.cx>2005-04-05 21:13:35 +0400
commit42aa06a575402b64d1d3657863f67f9bc74417be (patch)
treeb9bb2180f74b8235682c58253a546145edd0084d /winsup/cygwin/cygtls.cc
parent4385bf124029f3e26f9a59247d92b63aa85cd34a (diff)
* cygtls.cc (_cygtls::remove): Don't free or close stuff if we're being called
in a "non-standard" way.
Diffstat (limited to 'winsup/cygwin/cygtls.cc')
-rw-r--r--winsup/cygwin/cygtls.cc21
1 files changed, 12 insertions, 9 deletions
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
{