Commit b7477f38 authored by Alex Brainman's avatar Alex Brainman

syscall: use ERROR_IO_PENDING value in errnoErr

So errnoErr can be used in other packages.
This is something I missed when I sent CL 28990.

Fixes #17539

Change-Id: I8ee3b79c4d70ca1e5b29e5b40024f7ae9a86061e
Reviewed-on: https://go-review.googlesource.com/29690Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent b992c391
...@@ -13,11 +13,11 @@ var _ unsafe.Pointer ...@@ -13,11 +13,11 @@ var _ unsafe.Pointer
// Do the interface allocations only once for common // Do the interface allocations only once for common
// Errno values. // Errno values.
const ( const (
errnoWSAEINPROGRESS = 10036 errnoERROR_IO_PENDING = 997
) )
var ( var (
errWSAEINPROGRESS error = syscall.Errno(errnoWSAEINPROGRESS) errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
) )
// errnoErr returns common boxed Errno values, to prevent // errnoErr returns common boxed Errno values, to prevent
...@@ -26,8 +26,8 @@ func errnoErr(e syscall.Errno) error { ...@@ -26,8 +26,8 @@ func errnoErr(e syscall.Errno) error {
switch e { switch e {
case 0: case 0:
return nil return nil
case errnoWSAEINPROGRESS: case errnoERROR_IO_PENDING:
return errWSAEINPROGRESS return errERROR_IO_PENDING
} }
// TODO: add more here, after collecting data on the common // TODO: add more here, after collecting data on the common
// error values see on Windows. (perhaps when running // error values see on Windows. (perhaps when running
......
...@@ -13,11 +13,11 @@ var _ unsafe.Pointer ...@@ -13,11 +13,11 @@ var _ unsafe.Pointer
// Do the interface allocations only once for common // Do the interface allocations only once for common
// Errno values. // Errno values.
const ( const (
errnoWSAEINPROGRESS = 10036 errnoERROR_IO_PENDING = 997
) )
var ( var (
errWSAEINPROGRESS error = syscall.Errno(errnoWSAEINPROGRESS) errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
) )
// errnoErr returns common boxed Errno values, to prevent // errnoErr returns common boxed Errno values, to prevent
...@@ -26,8 +26,8 @@ func errnoErr(e syscall.Errno) error { ...@@ -26,8 +26,8 @@ func errnoErr(e syscall.Errno) error {
switch e { switch e {
case 0: case 0:
return nil return nil
case errnoWSAEINPROGRESS: case errnoERROR_IO_PENDING:
return errWSAEINPROGRESS return errERROR_IO_PENDING
} }
// TODO: add more here, after collecting data on the common // TODO: add more here, after collecting data on the common
// error values see on Windows. (perhaps when running // error values see on Windows. (perhaps when running
......
...@@ -831,8 +831,12 @@ var _ unsafe.Pointer ...@@ -831,8 +831,12 @@ var _ unsafe.Pointer
// Do the interface allocations only once for common // Do the interface allocations only once for common
// Errno values. // Errno values.
const (
errnoERROR_IO_PENDING = 997
)
var ( var (
errERROR_IO_PENDING error = {{syscalldot}}Errno(ERROR_IO_PENDING) errERROR_IO_PENDING error = {{syscalldot}}Errno(errnoERROR_IO_PENDING)
) )
// errnoErr returns common boxed Errno values, to prevent // errnoErr returns common boxed Errno values, to prevent
...@@ -841,7 +845,7 @@ func errnoErr(e {{syscalldot}}Errno) error { ...@@ -841,7 +845,7 @@ func errnoErr(e {{syscalldot}}Errno) error {
switch e { switch e {
case 0: case 0:
return nil return nil
case ERROR_IO_PENDING: case errnoERROR_IO_PENDING:
return errERROR_IO_PENDING return errERROR_IO_PENDING
} }
// TODO: add more here, after collecting data on the common // TODO: add more here, after collecting data on the common
......
...@@ -11,8 +11,12 @@ var _ unsafe.Pointer ...@@ -11,8 +11,12 @@ var _ unsafe.Pointer
// Do the interface allocations only once for common // Do the interface allocations only once for common
// Errno values. // Errno values.
const (
errnoERROR_IO_PENDING = 997
)
var ( var (
errERROR_IO_PENDING error = Errno(ERROR_IO_PENDING) errERROR_IO_PENDING error = Errno(errnoERROR_IO_PENDING)
) )
// errnoErr returns common boxed Errno values, to prevent // errnoErr returns common boxed Errno values, to prevent
...@@ -21,7 +25,7 @@ func errnoErr(e Errno) error { ...@@ -21,7 +25,7 @@ func errnoErr(e Errno) error {
switch e { switch e {
case 0: case 0:
return nil return nil
case ERROR_IO_PENDING: case errnoERROR_IO_PENDING:
return errERROR_IO_PENDING return errERROR_IO_PENDING
} }
// TODO: add more here, after collecting data on the common // TODO: add more here, after collecting data on the common
......
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