use syswrap to close file after opening it with syswrap

This commit is contained in:
Seebs 2020-05-22 13:28:57 -05:00 committed by Jaden Weiss
parent 3e7f0b32e9
commit 176d49e4b5
No known key found for this signature in database
GPG key ID: 177F065773634B67

View file

@ -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)
}