From cca73de6a101366e670962b089ba4403ac4a4834 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Sat, 14 Nov 2020 09:23:27 +0100 Subject: [PATCH] lib/osutil: Consider sync() best effort (fixes #7117) --- lib/osutil/atomic.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/osutil/atomic.go b/lib/osutil/atomic.go index 48c99d301..c2f6dd6e9 100644 --- a/lib/osutil/atomic.go +++ b/lib/osutil/atomic.go @@ -83,10 +83,8 @@ func (w *AtomicWriter) Close() error { // Try to not leave temp file around, but ignore error. defer w.fs.Remove(w.next.Name()) - if err := w.next.Sync(); err != nil { - w.err = err - return err - } + // sync() isn't supported everywhere, our best effort will suffice. + _ = w.next.Sync() if err := w.next.Close(); err != nil { w.err = err