Mercurial > vim
comparison src/channel.c @ 8072:38887bf423ba v7.4.1330
commit https://github.com/vim/vim/commit/0943a09db84b036ec550d7f2e5b832f621b400ca
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Feb 16 13:11:17 2016 +0100
patch 7.4.1330
Problem: fd_read() has an unused argument.
Solution: Remove the timeout. (Yasuhiro Matsumoto)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 16 Feb 2016 13:15:04 +0100 |
parents | e4c3f6720b03 |
children | dc32c8026899 |
comparison
equal
deleted
inserted
replaced
8071:a4cd495eb365 | 8072:38887bf423ba |
---|---|
45 # endif | 45 # endif |
46 # define SOCK_ERRNO | 46 # define SOCK_ERRNO |
47 # define sock_write(sd, buf, len) write(sd, buf, len) | 47 # define sock_write(sd, buf, len) write(sd, buf, len) |
48 # define sock_read(sd, buf, len) read(sd, buf, len) | 48 # define sock_read(sd, buf, len) read(sd, buf, len) |
49 # define sock_close(sd) close(sd) | 49 # define sock_close(sd) close(sd) |
50 # define fd_read(fd, buf, len, timeout) read(fd, buf, len) | 50 # define fd_read(fd, buf, len) read(fd, buf, len) |
51 # define fd_write(sd, buf, len) write(sd, buf, len) | 51 # define fd_write(sd, buf, len) write(sd, buf, len) |
52 # define fd_close(sd) close(sd) | 52 # define fd_close(sd) close(sd) |
53 #endif | 53 #endif |
54 | 54 |
55 #ifdef FEAT_GUI_W32 | 55 #ifdef FEAT_GUI_W32 |
56 extern HWND s_hwnd; /* Gvim's Window handle */ | 56 extern HWND s_hwnd; /* Gvim's Window handle */ |
57 #endif | 57 #endif |
58 | 58 |
59 #ifdef WIN32 | 59 #ifdef WIN32 |
60 static int | 60 static int |
61 fd_read(sock_T fd, char_u *buf, size_t len, int timeout) | 61 fd_read(sock_T fd, char_u *buf, size_t len) |
62 { | 62 { |
63 HANDLE h = (HANDLE)fd; | 63 HANDLE h = (HANDLE)fd; |
64 DWORD nread; | 64 DWORD nread; |
65 | 65 |
66 if (!ReadFile(h, buf, (DWORD)len, &nread, NULL)) | 66 if (!ReadFile(h, buf, (DWORD)len, &nread, NULL)) |
1502 if (channel_wait(channel, fd, 0) == FAIL) | 1502 if (channel_wait(channel, fd, 0) == FAIL) |
1503 break; | 1503 break; |
1504 if (use_socket) | 1504 if (use_socket) |
1505 len = sock_read(fd, buf, MAXMSGSIZE); | 1505 len = sock_read(fd, buf, MAXMSGSIZE); |
1506 else | 1506 else |
1507 len = fd_read(fd, buf, MAXMSGSIZE, channel->ch_timeout); | 1507 len = fd_read(fd, buf, MAXMSGSIZE); |
1508 if (len <= 0) | 1508 if (len <= 0) |
1509 break; /* error or nothing more to read */ | 1509 break; /* error or nothing more to read */ |
1510 | 1510 |
1511 /* Store the read message in the queue. */ | 1511 /* Store the read message in the queue. */ |
1512 channel_save(channel, buf, len); | 1512 channel_save(channel, buf, len); |