Jonathan Nieder <jrnie...@gmail.com> writes: > Junio C Hamano wrote: >> Jonathan Nieder <jrnie...@gmail.com> 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.
An unrelated tangent but we may want to fix majority of callers that do not seem to know that ;-) -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html