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>2004-10-27 01:13:50 +0400
committerChristopher Faylor <me@cgf.cx>2004-10-27 01:13:50 +0400
commit5957d504f0da6ed6614bbb790b79d1224f4b639d (patch)
tree9820b4036e244aa4ec86cb6ffa171ead3d8444a9 /winsup/cygwin/select.cc
parent3d43992262f596388dbd1fa6b1193916be97b25a (diff)
* cygtls.cc (_cygtls::fixup_after_fork): Wipe out exitsock local since it
should not be used by the child. * select.cc (start_thread_socket): Turn off inheritance for exitsock. Don't add exitsock to exception mask since it should never get an exception. (socket_cleanup): Change some debug messages for consistency. * fhandler_socket.cc (fhandler_socket::dup): Change comment wording slightly.
Diffstat (limited to 'winsup/cygwin/select.cc')
-rw-r--r--winsup/cygwin/select.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index 30b19f786..a0dc1318e 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -1371,11 +1371,14 @@ start_thread_socket (select_record *me, select_stuff *stuff)
select_printf ("getsockname error");
goto err;
}
+ if (winsock2_active && wincap.has_set_handle_information ())
+ SetHandleInformation ((HANDLE) si->exitsock, HANDLE_FLAG_INHERIT, 0);
+ /* else
+ too bad? */
}
select_printf ("exitsock %p", si->exitsock);
WINSOCK_FD_SET ((HANDLE) si->exitsock, &si->readfds);
- WINSOCK_FD_SET ((HANDLE) si->exitsock, &si->exceptfds);
stuff->device_specific_socket = (void *) si;
si->start = &stuff->start;
select_printf ("stuff_start %p", &stuff->start);
@@ -1400,11 +1403,11 @@ socket_cleanup (select_record *, select_stuff *stuff)
int res = sendto (_my_tls.locals.exitsock, buf, 1, 0,
(sockaddr *) &_my_tls.locals.exitsock_sin,
sizeof (_my_tls.locals.exitsock_sin));
- select_printf ("sent a byte to the exit sock %p, res %d", _my_tls.locals.exitsock, res);
+ select_printf ("sent a byte to exitsock %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);
+ select_printf ("reading a byte from exitsock %p", si->exitsock);
res = recv (si->exitsock, buf, 1, 0);
select_printf ("recv returned %d", res);
stuff->device_specific_socket = NULL;