Re: [PATCH 1/2] prefer xwrite instead of write

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

 



Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@xxxxxxxxx> writes:

>> Shouldn't this use write_in_full() to avoid a silently truncated result? (*)
>
> Meaning this?  If so, I think it makes sense.
[...]
> -	if (xwrite(fd, out.buf, out.len) < 0)
> +	if (write_in_full(fd, out.buf, out.len) != out.len)

Yes.  Either '< 0' or '!= out.len' would work fine here, since
write_in_full is defined to always either write the full 'count'
bytes or return an error.

Thanks,
Jonathan
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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]