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

Re: Possible Solaris problem in 'checkout_entry()'

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Mar 17, 2008, 15:37 UTC
Message-ID
<alpine.LFD.1.00.0803170832280.3020@woody.linux-foundation.org>
In-Reply-To
<118833cc0803170823q1e1e29a9p18b9a41f6975e268@mail.gmail.com>
On Mon, 17 Mar 2008, Morten Welinder wrote:
>
> >                 unlink(path);
> 
> And checking the result from unlink might not hurt either.

Well, that part is actually intentional. We simply don't care. If the unlink succeeds, we're happy, if it fails, we're happy. No reason to test, really.

(Well, it's not that we're "happy" if the unlink fails, but we actually _expect_ it to fail for directories, and regardless of that we're really doing the _real_ error handling later when we actually create the new entry that will replace the old one, so we don't much care at unlink time).

IOW, the real "checking" is taking place in "create_file()", so if the unlinking failed (due to a read-only directory or something), that's where we'll do the proper error reporting.

		Linus
Previous: Morten WelinderNext: Linus Torvalds
Message 3 of 5 in “Possible Solaris problem in 'checkout_entry()'”
  1. Linus TorvaldsMar 17, 2008
  2. Morten WelinderMar 17, 2008
  3. Linus TorvaldsMar 17, 2008
  4. Linus TorvaldsMar 17, 2008
  5. Junio C HamanoMar 19, 2008

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.