mirror of
https://github.com/golang/go
synced 2024-11-22 03:34:40 -07:00
os.ReadAt doesn't return EOF at EOF.
thanks to lionkov for the fix. Fixes #262. R=rsc CC=golang-dev https://golang.org/cl/156097
This commit is contained in:
parent
4aaf948f90
commit
4e201c7f20
@ -138,6 +138,9 @@ func (file *File) ReadAt(b []byte, off int64) (n int, err Error) {
|
||||
}
|
||||
for len(b) > 0 {
|
||||
m, e := syscall.Pread(file.fd, b, off);
|
||||
if m == 0 && e == 0 {
|
||||
return n, EOF
|
||||
}
|
||||
n += m;
|
||||
if e != 0 {
|
||||
err = &PathError{"read", file.name, Errno(e)};
|
||||
|
Loading…
Reference in New Issue
Block a user