git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Linus TorvaldsNext: Linus Torvalds
Message 2 of 4 in “Clean up write_in_full() users”
  1. Linus TorvaldsJan 12, 2007
  2. Shawn O. PearceJan 12, 2007
  3. Linus TorvaldsJan 12, 2007
  4. Morten WelinderJan 12, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.