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

Re: gc considered dangerous

From
Mike Hommey <mh@glandium.org>
Date
Feb 9, 2009, 06:59 UTC
Message-ID
<20090209065919.GB13257@glandium.org>
In-Reply-To
<7vhc34y9za.fsf@gitster.siamese.dyndns.org>
On Sun, Feb 08, 2009 at 12:00:57PM -0800, Junio C Hamano wrote:
Show 13 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > My preliminary guess is that this code in pack-write.c needs to use the 
> > lock file paradigm:
> >
> >         if (!index_name) {
> > 		[...]
> >         } else {
> >                 unlink(index_name);
> >                 fd = open(index_name, O_CREAT|O_EXCL|O_WRONLY, 0600);
> >         }
> 
> Whoa.  That particular code has been (and is still) correct.

Don't both unlink and open fail in the case the index file is locked in Windows ?

Mike
Previous: Robin RosenbergNext: Junio C Hamano
Message 11 of 13 in “gc considered dangerous”
  1. Robin RosenbergFeb 8, 2009
  2. Robin RosenbergFeb 8, 2009
  3. Johannes SchindelinFeb 8, 2009
  4. Robin RosenbergFeb 8, 2009
  5. Johannes SchindelinFeb 8, 2009
  6. Steffen ProhaskaFeb 8, 2009
  7. Robin RosenbergFeb 8, 2009
  8. Junio C HamanoFeb 8, 2009
  9. Robin RosenbergFeb 8, 2009
  10. Robin RosenbergFeb 8, 2009
  11. Mike HommeyFeb 9, 2009
  12. Junio C HamanoFeb 9, 2009
  13. Junio C HamanoFeb 8, 2009

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.