summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/cygtls.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/cygtls.cc')
-rw-r--r--winsup/cygwin/cygtls.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/winsup/cygwin/cygtls.cc b/winsup/cygwin/cygtls.cc
index a409fda04..4dcd5df8f 100644
--- a/winsup/cygwin/cygtls.cc
+++ b/winsup/cygwin/cygtls.cc
@@ -92,6 +92,10 @@ _cygtls::call2 (DWORD (*func) (void *, void *), void *arg, void *buf)
_my_tls.init_thread (buf, func);
DWORD res = func (arg, buf);
_my_tls.remove (INFINITE);
+ // FIXME: Need some sort of atthreadexit function to allow things like
+ // select to control this themselves
+ if (_my_tls.locals.exitsock != INVALID_SOCKET)
+ closesocket (_my_tls.locals.exitsock);
ExitThread (res);
}
@@ -114,6 +118,7 @@ _cygtls::init_thread (void *x, DWORD (*func) (void *, void *))
}
local_clib._current_locale = "C";
locals.process_logmask = LOG_UPTO (LOG_DEBUG);
+ locals.exitsock = INVALID_SOCKET;
}
set_state (false);