* cygtls.cc (_cygtls::init_thread): Move exitsock setting later. It should

always be set.
(_cygtls::remove): Detect zero exitsock.  Not quite sure why this is needed.
This commit is contained in:
Christopher Faylor 2005-03-03 00:32:57 +00:00
parent 6b55d9fa5e
commit d845acc8d2
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2005-03-02 Christopher Faylor <cgf@timesys.com>
* cygtls.cc (_cygtls::init_thread): Move exitsock setting later. It
should always be set.
(_cygtls::remove): Detect zero exitsock. Not quite sure why this is needed.
2005-03-02 Christopher Faylor <cgf@timesys.com>
* autoload.cc (LoadDLLprime): Mask error code to low-order 16 bits.

View File

@ -113,9 +113,9 @@ _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;
}
locals.exitsock = INVALID_SOCKET;
set_state (false);
errno_addr = &(local_clib._errno);
@ -154,7 +154,7 @@ _cygtls::remove (DWORD wait)
debug_printf ("wait %p\n", wait);
// FIXME: Need some sort of atthreadexit function to allow things like
// select to control this themselves
if (_my_tls.locals.exitsock != INVALID_SOCKET)
if (locals.exitsock && locals.exitsock != INVALID_SOCKET)
closesocket (locals.exitsock);
do
{