From ffd7cfce4b6113280783136b6580f5bca55e27e2 Mon Sep 17 00:00:00 2001 From: Hiroshi Ioka Date: Fri, 21 Apr 2017 17:10:58 +0900 Subject: os, syscall: fix errno in Seek on windows Current implementation use EPIPE as an error for Seek on pipes. According to http://pubs.opengroup.org/onlinepubs/009695399/functions/lseek.html, it should use ESPIPE instead. Fixes #20066 Change-Id: I24c3b95be946bc19a287d6b10f447b034a9a1283 Reviewed-on: https://go-review.googlesource.com/41311 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- src/syscall/syscall_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/syscall') diff --git a/src/syscall/syscall_windows.go b/src/syscall/syscall_windows.go index 19a7deb230..7f92bf7ca4 100644 --- a/src/syscall/syscall_windows.go +++ b/src/syscall/syscall_windows.go @@ -348,7 +348,7 @@ func Seek(fd Handle, offset int64, whence int) (newoffset int64, err error) { // use GetFileType to check pipe, pipe can't do seek ft, _ := GetFileType(fd) if ft == FILE_TYPE_PIPE { - return 0, EPIPE + return 0, ESPIPE } rlo, e := SetFilePointer(fd, lo, &hi, w) if e != nil { -- cgit v1.3-5-g9baa