Re: [PATCH perf/core v2 1/8] perf: Rewrite strbuf not to die

From: Arnaldo Carvalho de Melo
Date: Thu May 05 2016 - 19:49:20 EST


Em Thu, May 05, 2016 at 08:25:38PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Sat, Apr 30, 2016 at 12:09:50AM +0900, Masami Hiramatsu escreveu:
> > @@ -112,12 +151,14 @@ ssize_t strbuf_read(struct strbuf *sb, int fd, ssize_t hint)
> > strbuf_release(sb);
> > else
> > strbuf_setlen(sb, oldlen);
> > - return -1;
> > + return cnt;
>
> This is unrelated, no?
>
> I.e. this _was_ already returning a failure code, but then you are
> propagating the read() return, which may even be a good idea, haven't
> thought about that, but is unrelated to what this patch is doing, please
> put it in a separate patch if you think it is a good idea.
>
> All the rest seems ok, going over the other patches now.

Just a bit annoying, but this is done when checking if cnt < 0, which
can only be -1 as per read's man page, so its ok, nevermind...

- Arnaldo