From: Jacob Keller Date: Tue, 22 Sep 2015 06:29:14 GMT Subject: Re: [PATCHv3 04/13] strbuf: add strbuf_read_once to read without blocking Message-ID: In-Reply-To: On Mon, Sep 21, 2015 at 5:17 PM, Junio C Hamano wrote: > Stefan Beller 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