1
mirror of https://github.com/rclone/rclone synced 2024-12-23 14:23:44 +01:00

config: fsync the config file after writing #3411

This should help with data integrity
This commit is contained in:
Nick Craig-Wood 2020-03-16 18:20:16 +00:00
parent 1e9b8e043a
commit 47e2d5c415

View File

@ -558,6 +558,7 @@ func saveConfig() error {
_ = enc.Close()
}
_ = f.Sync()
err = f.Close()
if err != nil {
return errors.Errorf("Failed to close config file: %v", err)