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.