summaryrefslogtreecommitdiff
path: root/src/time/sys_unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/time/sys_unix.go')
-rw-r--r--src/time/sys_unix.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/time/sys_unix.go b/src/time/sys_unix.go
index e592415daa..dea03e06d5 100644
--- a/src/time/sys_unix.go
+++ b/src/time/sys_unix.go
@@ -8,6 +8,7 @@ package time
import (
"errors"
+ "io"
"syscall"
)
@@ -55,9 +56,9 @@ func closefd(fd uintptr) {
}
func preadn(fd uintptr, buf []byte, off int) error {
- whence := 0
+ whence := io.SeekStart
if off < 0 {
- whence = 2
+ whence = io.SeekEnd
}
if _, err := syscall.Seek(int(fd), int64(off), whence); err != nil {
return err