mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-19 12:04:03 +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:
+1
-1
@@ -50,7 +50,7 @@ func tempDir() string {
|
||||
func (f unixFileHandle) ReadAt(b []byte, offset int64) (n int, err error) {
|
||||
n, err = syscall.Pread(syscallFd(f), b, offset)
|
||||
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