* dtable.cc (dtable::dup2): Store fd for fhandler_socket.

* fhandler.h (fhandler_base::set_fd): New virtual method.
	(fhandler_base::get_fd): Ditto.
	(fhandler_socket::set_fd): Ditto.
	(fhandler_socket::get_fd): Ditto.
	* fhandler_socket.cc (fhandler_socket::read): Call cygwin_recv instead
	of native Winsock recv.
	(fhandler_socket::write): Call cygwin_send instead of native Winsock
	send.
	* net.cc (fdsock): Store fd in fhandler_socket.
This commit is contained in:
Corinna Vinschen
2002-02-08 11:54:10 +00:00
parent 9f25eed9c9
commit fae28904e9
5 changed files with 32 additions and 3 deletions

View File

@@ -411,6 +411,7 @@ dtable::dup2 (int oldfd, int newfd)
if (!not_open (newfd))
_close (newfd);
fds[newfd] = newfh;
newfh->set_fd (newfd);
ReleaseResourceLock (LOCK_FD_LIST, WRITE_LOCK | READ_LOCK, "dup");
MALLOC_CHECK;