From 9905786a044d421fb937bc52855defc2b45893f8 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 24 May 2006 00:56:24 +0000 Subject: [PATCH] * select.cc (start_thread_socket): Clean up exitsock in case of error. Use si->exitcode consistently. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/select.cc | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 9dd8d341c..56f28373a 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2006-05-23 Lev Bishop + Christopher Faylor + + * select.cc (start_thread_socket): Clean up exitsock in case of + error. Use si->exitcode consistently. + 2006-05-21 Christopher Faylor * child_info.h (_CI_SAW_CTRL_C): New enum. diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index f03292fb9..1b6215916 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -1406,7 +1406,7 @@ start_thread_socket (select_record *me, select_stuff *stuff) else { si->exitsock = _my_tls.locals.exitsock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP); - if (_my_tls.locals.exitsock == INVALID_SOCKET) + if (si->exitsock == INVALID_SOCKET) { set_winsock_errno (); select_printf ("cannot create socket, %E"); @@ -1431,7 +1431,7 @@ start_thread_socket (select_record *me, select_stuff *stuff) SetHandleInformation ((HANDLE) si->exitsock, HANDLE_FLAG_INHERIT, 0); /* else too bad? */ - select_printf ("opened new socket %p", _my_tls.locals.exitsock); + select_printf ("opened new socket %p", si->exitsock); } select_printf ("exitsock %p", si->exitsock); @@ -1446,6 +1446,7 @@ start_thread_socket (select_record *me, select_stuff *stuff) err: set_winsock_errno (); closesocket (si->exitsock); + si->exitsock = INVALID_SOCKET; return -1; }