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:
authorCorinna Vinschen <corinna@vinschen.de>2001-08-15 11:49:15 +0400
committerCorinna Vinschen <corinna@vinschen.de>2001-08-15 11:49:15 +0400
commit5fd12fb0cc61778a909bdae69d8f61d644e135ba (patch)
treeca8096e1a0fb1acc80061ecca2d966269a75b802 /winsup/cygwin/fhandler_socket.cc
parentda3ea61edda86f0f1c3176b5b1ee30265c5ec1a3 (diff)
* 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'.
Diffstat (limited to 'winsup/cygwin/fhandler_socket.cc')
-rw-r--r--winsup/cygwin/fhandler_socket.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index 7c1be0715..9e6348903 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -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;
}