From: Jeff King Date: Fri, 15 Sep 2017 00:43:41 GMT Subject: Re: [PATCH 6/7] notes-merge: use ssize_t for write_in_full() return value Message-ID: <20170915004341.zwmpkvcvjgifn5zn@sigill.intra.peff.net> In-Reply-To: <20170913212035.GN27425@aiede.mtv.corp.google.com> On Wed, Sep 13, 2017 at 02:20:35PM -0700, Jonathan Nieder wrote: > > --- a/notes-merge.c > > +++ b/notes-merge.c > > @@ -302,7 +302,7 @@ static void write_buf_to_worktree(const struct object_id *obj, > > fd = xopen(path, O_WRONLY | O_EXCL | O_CREAT, 0666); > > > > while (size > 0) { > > - long ret = write_in_full(fd, buf, size); > > + ssize_t ret = write_in_full(fd, buf, size); > > if (ret < 0) { > > /* Ignore epipe */ > > if (errno == EPIPE) > > break; > > die_errno("notes-merge"); > > } else if (!ret) { > > die("notes-merge: disk full?"); > > } > > These three lines are dead code. How about the following, e.g. for > squashing in? Thanks, I didn't notice that. I'd actually prefer it as a separate patch, since it needs explained separately. -Peff