Re: Clean up write_in_full() users
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Jan 12, 2007, 04:33 UTC
- Message-ID
- <20070112043346.GB24195@spearce.org>
- In-Reply-To
- <Pine.LNX.4.64.0701112014050.3594@woody.osdl.org>
Linus Torvalds <torvalds@osdl.org> wrote:
> I actually think "read_in_full()" should get the same loving tender care > too, for all the same reasons. I think "read_or_die()" is totally broken. > Anybody who uses "read_or_die()" is buggy by definition, since it will do > a partial read AND NOT RETURN ANY INDICATION THAT IT WAS PARTIAL!
AFAIK the only user of read_or_die is sha1_file.c when it reads in the 12 byte pack header and the 20 byte pack trailer to "quickly" verify the packfile is sane before using it. If I recall correctly it was correct when I created it, but the read_in_full refactoring changed it.
-- Shawn.