Mercurial > emacs
comparison src/w32.c @ 48545:538af265a4a7
(sys_write): Avoid non-blocking mode, which is not fully
supported.
author | Jason Rumney <jasonr@gnu.org> |
---|---|
date | Mon, 25 Nov 2002 23:30:19 +0000 |
parents | 4d7b83cc03aa |
children | b4fb06f61bfd |
comparison
equal
deleted
inserted
replaced
48544:25945a0f9ea5 | 48545:538af265a4a7 |
---|---|
3707 } | 3707 } |
3708 | 3708 |
3709 #ifdef HAVE_SOCKETS | 3709 #ifdef HAVE_SOCKETS |
3710 if (fd_info[fd].flags & FILE_SOCKET) | 3710 if (fd_info[fd].flags & FILE_SOCKET) |
3711 { | 3711 { |
3712 unsigned long nblock = 0; | |
3712 if (winsock_lib == NULL) abort (); | 3713 if (winsock_lib == NULL) abort (); |
3714 | |
3715 /* TODO: implement select() properly so non-blocking I/O works. */ | |
3716 /* For now, make sure the write blocks. */ | |
3717 if (fd_info[fd].flags & FILE_NDELAY) | |
3718 pfn_ioctlsocket (SOCK_HANDLE (fd), FIONBIO, &nblock); | |
3719 | |
3713 nchars = pfn_send (SOCK_HANDLE (fd), buffer, count, 0); | 3720 nchars = pfn_send (SOCK_HANDLE (fd), buffer, count, 0); |
3721 | |
3722 /* Set the socket back to non-blocking if it was before, | |
3723 for other operations that support it. */ | |
3724 if (fd_info[fd].flags & FILE_NDELAY) | |
3725 { | |
3726 nblock = 1; | |
3727 pfn_ioctlsocket (SOCK_HANDLE (fd), FIONBIO, &nblock); | |
3728 } | |
3729 | |
3714 if (nchars == SOCKET_ERROR) | 3730 if (nchars == SOCKET_ERROR) |
3715 { | 3731 { |
3716 DebPrint(("sys_read.send failed with error %d on socket %ld\n", | 3732 DebPrint(("sys_read.send failed with error %d on socket %ld\n", |
3717 pfn_WSAGetLastError (), SOCK_HANDLE (fd))); | 3733 pfn_WSAGetLastError (), SOCK_HANDLE (fd))); |
3718 set_errno (); | 3734 set_errno (); |