* fhandler.cc (fhandler_base::is_nonblocking): New method.
(fhandler_base::set_nonblocking): Ditto. * fhandler.h (fhandler_base): Declare new methods `is_nonblocking' and `set_nonblocking'. * fhandler_socket.cc (fhandler_socket::ioctl): Use `set_nonblocking'. * fhandler_tty.cc (fhandler_pty_master::process_slave_output): Use `is_nonblocking'. (fhandler_tty_slave::read): Ditto. (fhandler_tty_slave::ioctl): Use `set_nonblocking'. (fhandler_pty_master::ioctl): Ditto. * net.cc (cygwin_sendto): Fallback to winsock 1 functionality in case of nonblocking IO. (cygwin_recvfrom): Ditto. (cygwin_recv): Ditto. (cygwin_send): Ditto. * syscalls.cc (_read): Use `is_nonblocking'.
This commit is contained in:
@ -406,9 +406,7 @@ fhandler_socket::ioctl (unsigned int cmd, void *p)
|
||||
if (*(int *) p && get_async ())
|
||||
WSAAsyncSelect (get_socket (), gethwnd (), WM_ASYNCIO, ASYNC_MASK);
|
||||
|
||||
int current = get_flags () & O_NONBLOCK_MASK;
|
||||
int new_flags = *(int *) p ? (!current ? O_NONBLOCK : current) : 0;
|
||||
set_flags ((get_flags () & ~O_NONBLOCK_MASK) | new_flags);
|
||||
set_nonblocking (*(int *) p);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user