On Fri, Nov 22, 2013 at 10:09, Stuart Henderson wrote:
> On 2013/11/22 07:25, Maxime Villard wrote:

>> If write() fails without EPIPE, d is decremented, and the function
>> keeps looping. If write() succeeds after several loops, d will be
>> negative, and the function will write from buf-XX.

When does write() fail and do we want to keep writing? (If I fill up
the filesystem, do I really want to spin here?)

> Shouldn't it be something more like this? Otherwise if the write() fails,
> we attempt writing one byte fewer for every retry.

That looks better to me.

Reply via email to