0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

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)
This commit is contained in:
Bram Moolenaar
2019-01-22 23:01:40 +01:00
parent f88af6e675
commit 31faed60bf
3 changed files with 19 additions and 3 deletions

View File

@@ -3181,7 +3181,13 @@ channel_wait(channel_T *channel, sock_T fd, int timeout)
if (r && nread > 0) if (r && nread > 0)
return CW_READY; return CW_READY;
if (r == 0)
if (channel->ch_named_pipe)
{
DisconnectNamedPipe((HANDLE)fd);
ConnectNamedPipe((HANDLE)fd, NULL);
}
else if (r == 0)
return CW_ERROR; return CW_ERROR;
/* perhaps write some buffer lines */ /* perhaps write some buffer lines */
@@ -3813,7 +3819,16 @@ channel_send(
if (part == PART_SOCK) if (part == PART_SOCK)
res = sock_write(fd, (char *)buf, len); res = sock_write(fd, (char *)buf, len);
else else
{
res = fd_write(fd, (char *)buf, len); res = fd_write(fd, (char *)buf, len);
#ifdef WIN32
if (channel->ch_named_pipe && res < 0)
{
DisconnectNamedPipe((HANDLE)fd);
ConnectNamedPipe((HANDLE)fd, NULL);
}
#endif
}
if (res < 0 && (errno == EWOULDBLOCK if (res < 0 && (errno == EWOULDBLOCK
#ifdef EAGAIN #ifdef EAGAIN
|| errno == EAGAIN || errno == EAGAIN

View File

@@ -644,8 +644,7 @@ endfunc
func Test_terminal_no_cmd() func Test_terminal_no_cmd()
" Does not work on Mac. " Does not work on Mac.
" Todo: make this work on Win32 again if has('mac')
if has('mac') || has('win32')
return return
endif endif
let buf = term_start('NONE', {}) let buf = term_start('NONE', {})

View File

@@ -791,6 +791,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
796,
/**/ /**/
795, 795,
/**/ /**/