X-Git-Url: https://ruderich.org/simon/gitweb/?p=nsscash%2Fnsscash.git;a=blobdiff_plain;f=state.go;h=59c885ae9cf17c9a15a2e980702926a24cf26339;hp=43fc598b1814bc17a92821587a40ed35b697c87a;hb=HEAD;hpb=4d994341317c2e700370950bd5fd9ac05963fc66 diff --git a/state.go b/state.go index 43fc598..59c885a 100644 --- a/state.go +++ b/state.go @@ -1,6 +1,6 @@ // Read and write the state file used to keep data over multiple runs -// Copyright (C) 2019-2020 Simon Ruderich +// Copyright (C) 2019-2021 Simon Ruderich // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -80,5 +80,9 @@ func WriteState(path string, state *State) error { if err != nil { return err } - return f.CloseAtomicallyReplace() + err = f.CloseAtomicallyReplace() + if err != nil { + return err + } + return syncPath(filepath.Dir(path)) }