On Tue, Dec 7, 2010 at 6:59 PM, Xavier de Gaye wrote:
>> I am not sure if the hack above is acceptable. I will look into the tty
>> attributes problem.
>
> The hack must not be used. Instead, when the error occurs in vim_read() and
> the error is EINTR, vim should retry reading from stdin.
The attached patch fixes the problem by retrying a read after an EINTR.
And actually there is no tty modes problem after vim has successfully
(with the patch) completed its task. When the window has been widened
while Benjamin test is running, new commands produce a garbled output.
But simply resizing the window once again restores xterm in a sane state.
--
Xavier
Les Chemins de Lokoti: http://lokoti.alwaysdata.net
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
diff --git a/src/fileio.c b/src/fileio.c
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -252,6 +252,7 @@
int wasempty; /* buffer was empty before reading */
colnr_T len;
long size = 0;
+ long size_to_read;
char_u *p;
off_t filesize = 0;
int skip_read = FALSE;
@@ -1373,7 +1374,11 @@
/*
* Read bytes from the file.
*/
- size = vim_read(fd, ptr, size);
+ size_to_read = size;
+ do
+ {
+ size = vim_read(fd, ptr, size_to_read);
+ } while (size == -1 && errno == EINTR);
}
if (size <= 0)