]> ruderich.org/simon Gitweb - nsscash/nsscash.git/commit
Use github.com/google/renameio for atomic file updates
authorSimon Ruderich <simon@ruderich.org>
Tue, 18 Feb 2020 05:02:17 +0000 (06:02 +0100)
committerSimon Ruderich <simon@ruderich.org>
Tue, 18 Feb 2020 05:02:17 +0000 (06:02 +0100)
commit4d994341317c2e700370950bd5fd9ac05963fc66
treeb8b205fd33c37b9914de0e3477310381c8270f56
parent1002c514a8530bb6608c556b4446e853be390917
Use github.com/google/renameio for atomic file updates

This also fixes a very unlikely race condition which could delete a
temporary file from a concurrent nsscash run if it chooses the same
temporary file name after os.Rename() was called but before our deferred
os.Remove() remove it. This race would cause the second nsscash run to
fail but not cause any corruption of persistent files.
README.adoc
file.go
go.mod
go.sum
main.go
state.go