Skip to content

Commit

Permalink
fswriters: honor nosync option
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
  • Loading branch information
giuseppe committed Nov 23, 2020
1 parent 874d086 commit eb34310
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/ioutils/fswriters.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ type syncFileCloser struct {
}

func (w syncFileCloser) Close() error {
if !defaultWriterOptions.NoSync {
return w.File.Close()
}
err := fdatasync(w.File)
if err1 := w.File.Close(); err == nil {
err = err1
Expand Down

0 comments on commit eb34310

Please sign in to comment.