From: Junio C Hamano Date: Thu, 17 Sep 2015 16:44:19 GMT Subject: Re: [PATCH 01/10] strbuf: Add strbuf_read_noblock Message-ID: In-Reply-To: <20150917163012.GB25837@sigill.intra.peff.net> On Thu, Sep 17, 2015 at 9:30 AM, Jeff King 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?