mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-19 20:14:04 +00:00
os: add a few upstream tests for Read and ReadAt, fix problems they exposed.
There are more upstream tests to pull in, but this is plenty for today.
This commit is contained in:
@@ -118,7 +118,7 @@ type unixFileHandle uintptr
|
||||
func (f unixFileHandle) Read(b []byte) (n int, err error) {
|
||||
n, err = syscall.Read(syscallFd(f), b)
|
||||
err = handleSyscallError(err)
|
||||
if n == 0 && err == nil {
|
||||
if n == 0 && len(b) > 0 && err == nil {
|
||||
err = io.EOF
|
||||
}
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user