Re: [PATCH 6/7] notes-merge: use ssize_t for write_in_full() return value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux