Browse Source

lib/osutil: Consider sync() best effort (fixes #7117)

Jakob Borg 5 years ago
parent
commit
cca73de6a1
1 changed files with 2 additions and 4 deletions
  1. 2 4
      lib/osutil/atomic.go

+ 2 - 4
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