Mercurial > vim
comparison src/channel.c @ 15577:f611222a4349 v8.1.0796
patch 8.1.0796: MS-Windows 7: problem with named pipe on channel
commit https://github.com/vim/vim/commit/31faed60bfd54ff8f612f6b311a6cbcd9e7ebedd
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 22 23:01:40 2019 +0100
patch 8.1.0796: MS-Windows 7: problem with named pipe on channel
Problem: MS-Windows 7: problem with named pipe on channel.
Solution: Put back the disconnect/connect calls. (Yasuhiro Matsumoto,
closes #3833)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 22 Jan 2019 23:15:05 +0100 |
parents | d89c5b339c2a |
children | bfbdef46aa7d |
comparison
equal
deleted
inserted
replaced
15576:5d765761b75c | 15577:f611222a4349 |
---|---|
3179 { | 3179 { |
3180 int r = PeekNamedPipe((HANDLE)fd, NULL, 0, NULL, &nread, NULL); | 3180 int r = PeekNamedPipe((HANDLE)fd, NULL, 0, NULL, &nread, NULL); |
3181 | 3181 |
3182 if (r && nread > 0) | 3182 if (r && nread > 0) |
3183 return CW_READY; | 3183 return CW_READY; |
3184 if (r == 0) | 3184 |
3185 if (channel->ch_named_pipe) | |
3186 { | |
3187 DisconnectNamedPipe((HANDLE)fd); | |
3188 ConnectNamedPipe((HANDLE)fd, NULL); | |
3189 } | |
3190 else if (r == 0) | |
3185 return CW_ERROR; | 3191 return CW_ERROR; |
3186 | 3192 |
3187 /* perhaps write some buffer lines */ | 3193 /* perhaps write some buffer lines */ |
3188 channel_write_any_lines(); | 3194 channel_write_any_lines(); |
3189 | 3195 |
3811 } | 3817 } |
3812 | 3818 |
3813 if (part == PART_SOCK) | 3819 if (part == PART_SOCK) |
3814 res = sock_write(fd, (char *)buf, len); | 3820 res = sock_write(fd, (char *)buf, len); |
3815 else | 3821 else |
3822 { | |
3816 res = fd_write(fd, (char *)buf, len); | 3823 res = fd_write(fd, (char *)buf, len); |
3824 #ifdef WIN32 | |
3825 if (channel->ch_named_pipe && res < 0) | |
3826 { | |
3827 DisconnectNamedPipe((HANDLE)fd); | |
3828 ConnectNamedPipe((HANDLE)fd, NULL); | |
3829 } | |
3830 #endif | |
3831 } | |
3817 if (res < 0 && (errno == EWOULDBLOCK | 3832 if (res < 0 && (errno == EWOULDBLOCK |
3818 #ifdef EAGAIN | 3833 #ifdef EAGAIN |
3819 || errno == EAGAIN | 3834 || errno == EAGAIN |
3820 #endif | 3835 #endif |
3821 )) | 3836 )) |