diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 542479350..aa6b2e455 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2005-03-02 Christopher Faylor + + * 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 * autoload.cc (LoadDLLprime): Mask error code to low-order 16 bits. diff --git a/winsup/cygwin/cygtls.cc b/winsup/cygwin/cygtls.cc index 9f0c97a58..cb5379526 100644 --- a/winsup/cygwin/cygtls.cc +++ b/winsup/cygwin/cygtls.cc @@ -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 {