aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2004-10-20 04:49:34 +0000
committerChristopher Faylor <me@cgf.cx>2004-10-20 04:49:34 +0000
commit4082a9eb4a8dba965ce6e1bcc86ee24c0f437bd7 (patch)
tree29cbbd67cd2b0376e67c762cc137b8f214793fef /winsup/cygwin
parentd134b48fd6f73f3d9b9d261103f0e4ecd0f9f6e1 (diff)
downloadnewlib-4082a9eb4a8dba965ce6e1bcc86ee24c0f437bd7.zip
newlib-4082a9eb4a8dba965ce6e1bcc86ee24c0f437bd7.tar.gz
newlib-4082a9eb4a8dba965ce6e1bcc86ee24c0f437bd7.tar.bz2
* select.cc (start_thread_socket): Remove attempt to delay reading of exitsock
or suffer occasional mysterious 60 second hangs. (socket_cleanup): Empty the exitsock here after the thread has terminated.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/select.cc11
2 files changed, 12 insertions, 6 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 968d409..89ac3e4 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2004-10-20 Christopher Faylor <cgf@timesys.com>
+
+ * select.cc (start_thread_socket): Remove attempt to delay reading of
+ exitsock or suffer occasional mysterious 60 second hangs.
+ (socket_cleanup): Empty the exitsock here after the thread has
+ terminated.
+
2004-10-19 Christopher Faylor <cgf@timesys.com>
* fhandler_console.cc (fhandler_console::fixup_after_exec): Fix error
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index b85e0bd..30b19f7 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -1346,12 +1346,7 @@ start_thread_socket (select_record *me, select_stuff *stuff)
}
if (_my_tls.locals.exitsock != INVALID_SOCKET)
- {
- char buf[1];
- si->exitsock = _my_tls.locals.exitsock;
- select_printf ("read a byte from %p", si->exitsock);
- recv (si->exitsock, buf, 1, 0);
- }
+ si->exitsock = _my_tls.locals.exitsock;
else
{
si->exitsock = _my_tls.locals.exitsock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP);
@@ -1408,6 +1403,10 @@ socket_cleanup (select_record *, select_stuff *stuff)
select_printf ("sent a byte to the exit sock %p, res %d", _my_tls.locals.exitsock, res);
/* Wait for thread to go away */
si->thread->detach ();
+ /* empty the socket */
+ select_printf ("reading a byte from %p", si->exitsock);
+ res = recv (si->exitsock, buf, 1, 0);
+ select_printf ("recv returned %d", res);
stuff->device_specific_socket = NULL;
delete si;
}