diff --git a/generation.go b/generation.go index 7c1361b1d..c22b73867 100644 --- a/generation.go +++ b/generation.go @@ -263,7 +263,7 @@ func (m *mmapGeneration) openFile() (shouldClose bool, err error) { } // do we actually want this in every openFile? I don't know. if err := syscall.Flock(int(m.file.Fd()), syscall.LOCK_EX|syscall.LOCK_NB); err != nil { - m.file.Close() + _ = syswrap.CloseFile(m.file) m.file = nil return false, fmt.Errorf("flock: %s", err) }