mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
lib/osutil: Consider sync() best effort (fixes #7117)
This commit is contained in:
parent
5e669e0ae1
commit
cca73de6a1
@ -83,10 +83,8 @@ func (w *AtomicWriter) Close() error {
|
|||||||
// Try to not leave temp file around, but ignore error.
|
// Try to not leave temp file around, but ignore error.
|
||||||
defer w.fs.Remove(w.next.Name())
|
defer w.fs.Remove(w.next.Name())
|
||||||
|
|
||||||
if err := w.next.Sync(); err != nil {
|
// sync() isn't supported everywhere, our best effort will suffice.
|
||||||
w.err = err
|
_ = w.next.Sync()
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := w.next.Close(); err != nil {
|
if err := w.next.Close(); err != nil {
|
||||||
w.err = err
|
w.err = err
|
||||||
|
Loading…
Reference in New Issue
Block a user