Re: [PATCHv3 04/13] strbuf: add strbuf_read_once to read without blocking
- From
Jacob Keller <jacob.keller@gmail.com>
- Date
- Sep 22, 2015, 06:29 UTC
- Message-ID
- <CA+P7+xpC+EiNTBqgwd0We+f-_xqfY0xx2BzvTGC7Owk-ay10fw@mail.gmail.com>
- In-Reply-To
- <xmqqoagv71es.fsf@gitster.mtv.corp.google.com>
On Mon, Sep 21, 2015 at 5:17 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
> Stefan Beller <sbeller@google.com> writes: > >> The new call will read a fd into a strbuf once. The underlying call > > "read from a fd" > >> xread_nonblock is meant to execute non blockingly if the fd is set to >> O_NONBLOCK. > > The latter sentence adds more questions than it answers. If the > file descriptor is not set to non-blocking, what happens? Is it a > bug in the caller, and if so do we give help to diagnose such a bug? >
I would vote for adding debugging for calling xread with O_NONBLOCK and for calling xread_nonblock without O_NONBLOCK.. I'm not sure the best way to do this, but it certainly feels like a bug to call xread with O_NONBLOCK set... And the same here...
Regards, Jake