Re: [PATCH 3/7] read_in_full: reset errno before reading
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Sep 26, 2017, 00:28 UTC
- Message-ID
- <20170926002805.GS27425@aiede.mtv.corp.google.com>
- In-Reply-To
- <20170926002510.xmusj6fkvb25fm5w@sigill.intra.peff.net>
Jeff King wrote:
> What do you think of patch 7 in light of this? If the short-read case > gives us a sane errno, should we even bother trying to consistently > handle its error separately?
I like the read_exactly_or_die variant because it makes callers more concise, but on the other hand a caller handling the error can write a more meaningful error message with the right amount of context.
So I think you're right that it's better to drop patch 7.
Thanks, Jonathan