* 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.
This commit is contained in:
parent
3d43992262
commit
5957d504f0
|
@ -1,3 +1,14 @@
|
||||||
|
2004-10-26 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2004-10-26 Pierre Humblet <pierre.humblet@ieee.org>
|
2004-10-26 Pierre Humblet <pierre.humblet@ieee.org>
|
||||||
|
|
||||||
* registry.cc (get_registry_hive_path): Simplify and add a
|
* registry.cc (get_registry_hive_path): Simplify and add a
|
||||||
|
|
|
@ -149,6 +149,7 @@ _cygtls::fixup_after_fork ()
|
||||||
sig = 0;
|
sig = 0;
|
||||||
}
|
}
|
||||||
stacklock = 0;
|
stacklock = 0;
|
||||||
|
locals.exitsock = INVALID_SOCKET;
|
||||||
wq.thread_ev = NULL;
|
wq.thread_ev = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -352,8 +352,8 @@ fhandler_socket::dup (fhandler_base *child)
|
||||||
debug_printf ("WSADuplicateSocket failed, trying DuplicateHandle");
|
debug_printf ("WSADuplicateSocket failed, trying DuplicateHandle");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We don't call fhandler_base::dup here since that requires to
|
/* We don't call fhandler_base::dup here since that requires
|
||||||
have winsock called from fhandler_base and it creates only
|
having winsock called from fhandler_base and it creates only
|
||||||
inheritable sockets which is wrong for winsock2. */
|
inheritable sockets which is wrong for winsock2. */
|
||||||
|
|
||||||
HANDLE nh;
|
HANDLE nh;
|
||||||
|
|
|
@ -1371,11 +1371,14 @@ start_thread_socket (select_record *me, select_stuff *stuff)
|
||||||
select_printf ("getsockname error");
|
select_printf ("getsockname error");
|
||||||
goto err;
|
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);
|
select_printf ("exitsock %p", si->exitsock);
|
||||||
WINSOCK_FD_SET ((HANDLE) si->exitsock, &si->readfds);
|
WINSOCK_FD_SET ((HANDLE) si->exitsock, &si->readfds);
|
||||||
WINSOCK_FD_SET ((HANDLE) si->exitsock, &si->exceptfds);
|
|
||||||
stuff->device_specific_socket = (void *) si;
|
stuff->device_specific_socket = (void *) si;
|
||||||
si->start = &stuff->start;
|
si->start = &stuff->start;
|
||||||
select_printf ("stuff_start %p", &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,
|
int res = sendto (_my_tls.locals.exitsock, buf, 1, 0,
|
||||||
(sockaddr *) &_my_tls.locals.exitsock_sin,
|
(sockaddr *) &_my_tls.locals.exitsock_sin,
|
||||||
sizeof (_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 */
|
/* Wait for thread to go away */
|
||||||
si->thread->detach ();
|
si->thread->detach ();
|
||||||
/* empty the socket */
|
/* 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);
|
res = recv (si->exitsock, buf, 1, 0);
|
||||||
select_printf ("recv returned %d", res);
|
select_printf ("recv returned %d", res);
|
||||||
stuff->device_specific_socket = NULL;
|
stuff->device_specific_socket = NULL;
|
||||||
|
|
Loading…
Reference in New Issue