On Wed, Dec 8, 2010 at 5:10 PM, Bram Moolenaar wrote:
>
> Xavier de Gaye wrote:
>
>> 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.
>>
>> ...
>>
> Thanks.  I think we need to wrap this in a function vim_read_retry() and
> perhaps use it in more places.
>


EINTR is not handled in many places, and among those in
netbeans_read() and in RealWaitForChar(). If an interrupt occurs in
netbeans_read() the socket is disconnected (although it is quite
difficult to build and synchronize a test case that would trigger such
an event).

It seems possible that the operating system may deliver an interrupt
while reading a file when this file is on an NFS mount, but it is not
clear if an editor application should be concerned with that.

What do you think of wrapping some of those system calls with a macro
such as the macro defined by gnu libc:

# define TEMP_FAILURE_RETRY(expression)             \
    ({ long int __result;                           \
        do __result = (long int) (expression);      \
        while (__result == -1L && errno == EINTR);  \
        __result; })
#endif


-- 
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

Reply via email to