Browse Source

autofile: ensure file is open in Sync

pull/1842/head
Ethan Buchman 7 years ago
parent
commit
0948343a6f
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      autofile/autofile.go

+ 5
- 0
autofile/autofile.go View File

@ -103,6 +103,11 @@ func (af *AutoFile) Sync() error {
af.mtx.Lock()
defer af.mtx.Unlock()
if af.file == nil {
if err := af.openFile(); err != nil {
return err
}
}
return af.file.Sync()
}


Loading…
Cancel
Save