coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3] tee: handle EAGAIN returned from fwrite/fclose()


From: Pádraig Brady
Subject: Re: [PATCH v3] tee: handle EAGAIN returned from fwrite/fclose()
Date: Mon, 5 Nov 2018 03:54:25 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 01/11/18 07:39, Kamil Dudka wrote:
> On Tuesday, September 11, 2018 3:05:20 PM CET Kamil Dudka wrote:
>> 'tee' expected the output file descriptors to operate in blocking mode
>> but this assumption might be invalidated by other programs connected to
>> the same terminal, as in the following example:
>>
>> $ telnet ... | tee log_file
>>
>> telnet calls ioctl(stdin, FIONBIO, [1]), which causes the O_NONBLOCK
>> flag to be set on tee's output, which is connected to the same terminal.
>>
>> This patch has zero impact unless EAGAIN returns from fwrite/fclose().
>> In that case 'tee' waits for the underlying file descriptor to become
>> writable again and then it writes the remaining data.
> 
> Are there still any concerns about the last version of this patch?
> 
> Is there anything I can do to move this forward?

I still don't see why tee is special here,
compared to any other filter.

The infinite timeout poll() also worries me.

There were also the 4 other possible options
I mentioned in the thread for avoiding the issue.

I'm not too enthusiastic for this one, sorry.

Pádraig



reply via email to

[Prev in Thread] Current Thread [Next in Thread]