Commit f2e946f9 authored by Dave Cheney's avatar Dave Cheney

os: return ErrInvalid if receiver is nil.

Fixes #7043.

Test coming in https://golang.org/cl/46820043

R=r, bradfitz
CC=golang-codereviews
https://golang.org/cl/38330045
parent f2e94b58
......@@ -144,7 +144,7 @@ func (f *File) Truncate(size int64) error {
// of recently written data to disk.
func (f *File) Sync() (err error) {
if f == nil {
return syscall.EINVAL
return ErrInvalid
}
if e := syscall.Fsync(f.fd); e != nil {
return NewSyscallError("fsync", e)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment