Re: [PATCH 01/10] strbuf: Add strbuf_read_noblock
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 17, 2015, 16:44 UTC
- Message-ID
- <CAPc5daVY=t27wkX2x7DSfObwxZuv37VYxi1XD-RKiS1mv4=6KA@mail.gmail.com>
- In-Reply-To
- <20150917163012.GB25837@sigill.intra.peff.net>
On Thu, Sep 17, 2015 at 9:30 AM, Jeff King <peff@peff.net> wrote:
> > So I think we would probably want to treat EAGAIN specially: return -1 > to signal to the caller but _don't_ truncate the strbuf.
Yeah, "don't truncate" is needed.
> Arguably we should actually return the number of bytes we _did_ read, > but then caller cannot easily tell the difference between EOF and > EAGAIN.
Why can't it check errno==EAGAIN/EWOULDBLOCK?