Commit 4e201c7f authored by Rob Pike's avatar Rob Pike

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
parent 4aaf948f
......@@ -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)};
......
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