Re: [PATCHv3 02/13] xread: poll on non blocking fds
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 23, 2015, 00:43 UTC
- Message-ID
- <xmqqzj0eynh3.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CAGZ79kYKxNAXhbmXEtMeBYeGqu8i4bcUW_hpjLaPSF4p5O=uBg@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
> We should not care if the call to poll failed, as we're in an infinite loop and > can only get out with the correct read(..).
I think I agree with that reasoning. The only thing we want out of this call to poll(2) is to delay calling read(2) again when we know we would get EAGAIN again; whether the reason why poll(2) returned is because of some error or because some data has become ready on the file descriptor, we no longer are in that "we know we would get EAGAIN" situation and do want to call read(2), which would return either the right error or perform a successful read to make some progress.
Sounds sensible.