]> granicus.if.org Git - vim/commitdiff
patch 8.1.0796: MS-Windows 7: problem with named pipe on channel v8.1.0796
authorBram Moolenaar <Bram@vim.org>
Tue, 22 Jan 2019 22:01:40 +0000 (23:01 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 22 Jan 2019 22:01:40 +0000 (23:01 +0100)
Problem:    MS-Windows 7: problem with named pipe on channel.
Solution:   Put back the disconnect/connect calls. (Yasuhiro Matsumoto,
            closes #3833)

src/channel.c
src/testdir/test_terminal.vim
src/version.c

index 41d19f51ed777c3ba47a491f16a0688a4afba5ca..3a80748a1259123102235abcf3e57031776eb32c 100644 (file)
@@ -3181,7 +3181,13 @@ channel_wait(channel_T *channel, sock_T fd, int timeout)
 
            if (r && nread > 0)
                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;
 
            /* perhaps write some buffer lines */
@@ -3813,7 +3819,16 @@ channel_send(
        if (part == PART_SOCK)
            res = sock_write(fd, (char *)buf, len);
        else
+       {
            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
 #ifdef EAGAIN
                        || errno == EAGAIN
index 960a85e978c4af07a7aface04d2aa3f1c3954bae..ea7d4b1b6aa9664eadfab18f02b016b1993fc607 100644 (file)
@@ -644,8 +644,7 @@ endfunc
 
 func Test_terminal_no_cmd()
   " Does not work on Mac.
-  " Todo: make this work on Win32 again
-  if has('mac') || has('win32')
+  if has('mac')
     return
   endif
   let buf = term_start('NONE', {})
index 91b35426200f2aa0371cfb562eb460fd28444895..a4decba70ee26b7b37a3bca6ac7db89ef891e34c 100644 (file)
@@ -791,6 +791,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    796,
 /**/
     795,
 /**/