Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2006-05-24 07:39:29 +0400
committerChristopher Faylor <me@cgf.cx>2006-05-24 07:39:29 +0400
commit12a7d844b91ae1fc56014a4af4ca91ab8cfca387 (patch)
treeff8fda3677d2dfd8f031d33ef4e6c6e592538c17 /winsup/cygwin/select.cc
parent9905786a044d421fb937bc52855defc2b45893f8 (diff)
* select.cc (start_thread_socket): Delay setting thread local exitsock until we
know it's correct. Return correct value on error.
Diffstat (limited to 'winsup/cygwin/select.cc')
-rw-r--r--winsup/cygwin/select.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index 1b6215916..84424bcc2 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -1405,12 +1405,12 @@ start_thread_socket (select_record *me, select_stuff *stuff)
si->exitsock = _my_tls.locals.exitsock;
else
{
- si->exitsock = _my_tls.locals.exitsock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+ si->exitsock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (si->exitsock == INVALID_SOCKET)
{
set_winsock_errno ();
select_printf ("cannot create socket, %E");
- return -1;
+ return 0;
}
int sin_len = sizeof (_my_tls.locals.exitsock_sin);
memset (&_my_tls.locals.exitsock_sin, 0, sin_len);
@@ -1432,6 +1432,7 @@ start_thread_socket (select_record *me, select_stuff *stuff)
/* else
too bad? */
select_printf ("opened new socket %p", si->exitsock);
+ _my_tls.locals.exitsock = si->exitsock;
}
select_printf ("exitsock %p", si->exitsock);
@@ -1446,8 +1447,7 @@ start_thread_socket (select_record *me, select_stuff *stuff)
err:
set_winsock_errno ();
closesocket (si->exitsock);
- si->exitsock = INVALID_SOCKET;
- return -1;
+ return 0;
}
void