]> git.sesse.net Git - plocate/commit
Make DatabaseBuilder write the file atomically.
authorSteinar H. Gunderson <steinar+nageru@gunderson.no>
Sat, 21 Nov 2020 14:34:59 +0000 (15:34 +0100)
committerSteinar H. Gunderson <steinar+nageru@gunderson.no>
Sat, 21 Nov 2020 14:34:59 +0000 (15:34 +0100)
commit2983b424187a853bcde96a8feff6ef0ae48db7d5
tree34f0da2d88191e9b9eeb3047fbc7faed194b0f14
parent3d0c863edc6eb65c0dc3a13d2745cab5ef0a6773
Make DatabaseBuilder write the file atomically.

By opening with O_TMPFILE, we guarantee we'll never be leaving
an unfinished file visible on the filesystem. The move across the
old one isn't atomic, but the window of failure is very small now.
database-builder.cpp
database-builder.h