]> git.proxmox.com Git - libgit2.git/commit - src/win32/posix_w32.c
filebuf: make unlocking atomic
authorCarlos Martín Nieto <cmn@dwim.me>
Fri, 4 Apr 2014 12:40:38 +0000 (14:40 +0200)
committerCarlos Martin Nieto <cmn@dwim.me>
Wed, 4 Jun 2014 18:58:18 +0000 (11:58 -0700)
commite58281aaba90a79bbe3206b0e876c09839541c01
tree2f2398d9c7d76351432a359d76715a68b0f0a858
parent90befde4a1938641dfdb9a7bdb9f361d1de5c26f
filebuf: make unlocking atomic

When renaming a lock file to its final location, we need to make sure
that it is replaced atomically.

We currently have a workaround for Windows by removing the target file.
This means that the target file, which may be a ref or a packfile, may
cease to exist for a short wile, which shold be avoided.

Implement the workaround only in Windows, by making sure that the file
we want to replace is writable.
src/filebuf.c
src/win32/posix_w32.c