src/usocket: Do not setblocking on destroy;

This results in unexpected behaviour if the socket has been `dup()`d, as O_NONBLOCK is shared.
Close is always 'blocking' anyway

See https://github.com/wahern/cqueues/issues/13 for an example use case
This commit is contained in:
daurnimator 2014-10-27 11:10:48 -04:00
parent d80bb0d82b
commit e602c2b271

View File

@ -92,7 +92,6 @@ int socket_close(void) {
\*-------------------------------------------------------------------------*/ \*-------------------------------------------------------------------------*/
void socket_destroy(p_socket ps) { void socket_destroy(p_socket ps) {
if (*ps != SOCKET_INVALID) { if (*ps != SOCKET_INVALID) {
socket_setblocking(ps);
close(*ps); close(*ps);
*ps = SOCKET_INVALID; *ps = SOCKET_INVALID;
} }