4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-31 19:40:33 +08:00

* select.cc (start_thread_socket): Clean up exitsock in case of error. Use

si->exitcode consistently.
This commit is contained in:
Christopher Faylor 2006-05-24 00:56:24 +00:00
parent f383bda56a
commit 9905786a04
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2006-05-23 Lev Bishop <lev.bishop+cygwin@gmail.com>
Christopher Faylor <cgf@timesys.com>
* select.cc (start_thread_socket): Clean up exitsock in case of
error. Use si->exitcode consistently.
2006-05-21 Christopher Faylor <cgf@timesys.com> 2006-05-21 Christopher Faylor <cgf@timesys.com>
* child_info.h (_CI_SAW_CTRL_C): New enum. * child_info.h (_CI_SAW_CTRL_C): New enum.

View File

@ -1406,7 +1406,7 @@ start_thread_socket (select_record *me, select_stuff *stuff)
else else
{ {
si->exitsock = _my_tls.locals.exitsock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP); 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 (); set_winsock_errno ();
select_printf ("cannot create socket, %E"); 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); SetHandleInformation ((HANDLE) si->exitsock, HANDLE_FLAG_INHERIT, 0);
/* else /* else
too bad? */ 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); select_printf ("exitsock %p", si->exitsock);
@ -1446,6 +1446,7 @@ start_thread_socket (select_record *me, select_stuff *stuff)
err: err:
set_winsock_errno (); set_winsock_errno ();
closesocket (si->exitsock); closesocket (si->exitsock);
si->exitsock = INVALID_SOCKET;
return -1; return -1;
} }