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

Re: [PATCH] Fix config lockfile handling.

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 14, 2007, 21:57 UTC
Message-ID
<7vfxy5os60.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1197665998-32386-2-git-send-email-krh@redhat.com>
Kristian Høgsberg <krh@redhat.com> writes:
> When we commit or roll back the lock file the fd is automatically closed,
> so don't do that again.

With your change, we do not check the return status from close(2) anymore, which means that we may have run out of diskspace without noticing and renamed the incomplete file into the real place. Oops?

At least the original code wouldn't have had that problem.

The right fix in the longer term would be to check the return value from the close(2) in commit_lock_file(), but it currently does not check on purpose, because the callers may have already closed the fd.

Previous: Kristian HøgsbergNext: Kristian Høgsberg
Message 4 of 5 in “config.c fixes, take 2”
  1. Kristian HøgsbergDec 14, 2007
  2. Fix config lockfile handling.Kristian Høgsberg, Dec 14, 2007
  3. Use a strbuf for building up section header and key/value pair strings.Kristian Høgsberg, Dec 14, 2007
  4. Junio C HamanoDec 14, 2007
  5. Kristian HøgsbergDec 17, 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.