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

Re: [PATCH] Support empty blob in fsck --lost-found

From
BJ Hargrave <bj@bjhargrave.com>
Date
Sep 11, 2011, 16:20 UTC
Message-ID
<E6A02216-CA67-4B66-AA8F-6DDE8AF7DF3A@bjhargrave.com>
In-Reply-To
<CAGdFq_hqfqdFyLY=KdA_QW5kH8Kjhx8Y18mHEga_Pdv8yzB2wg@mail.gmail.com>
On Sep 11, 2011, at 12:03 , Sverre Rabbelier wrote:
Show 11 quoted lines
> Heya,
> 
> On Sun, Sep 11, 2011 at 17:40, BJ Hargrave <bj@bjhargrave.com> wrote:
>> fsck --lost-found died when attempting to write out the empty blob.
>> Avoid calling fwrite when the blob size is zero since the call to
>> fwrite returns 0 objects written which fails the check and caused
>> fsck to die.
> 
> Now we don't die at all if a 0-byte file couldn't be written.
> Shouldn't we check errno or something?
> 
You don't need to write anything to the 0-byte file. Just create it and close it and there are checks already that verify the fopen and fclose do not fail. So I don't think we are missing any error conditions here.
> -- 
> Cheers,
> 
> Sverre Rabbelier
-- 
BJ Hargrave
Previous: Sverre RabbelierNext: Sverre Rabbelier
Message 3 of 7 in “Support empty blob in fsck --lost-found”
  1. Support empty blob in fsck --lost-foundBJ Hargrave, Sep 11, 2011
  2. Sverre RabbelierSep 11, 2011
  3. BJ HargraveSep 11, 2011
  4. Sverre RabbelierSep 11, 2011
  5. Junio C HamanoSep 11, 2011
  6. BJ HargraveSep 11, 2011
  7. Junio C HamanoSep 12, 2011

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.