mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-06 09:07:16 -04:00
go.sys/windows: use syscall.Errno for windows errors
If we use a local type, it won't compare properly with errors from the rest of the standard library. Errors are the one type from syscall that propagates through the system, so it's important to have only one type for them. mkerrors_windows.sh is gone, so: - rename zerrors_windows.go and delete its DO NOT EDIT mark - delete the contentless zerrors_windows_*.go files LGTM=rsc R=rsc CC=alex.brainman, golang-codereviews https://golang.org/cl/122600043
This commit is contained in:
@@ -271,7 +271,7 @@ func (r *Rets) useLongHandleErrorCode(retvar string) string {
|
||||
// SetErrorCode returns source code that sets return parameters.
|
||||
func (r *Rets) SetErrorCode() string {
|
||||
const code = `if r0 != 0 {
|
||||
%s = %sErrno(r0)
|
||||
%s = syscall.Errno(r0)
|
||||
}`
|
||||
if r.Name == "" && !r.ReturnsError {
|
||||
return ""
|
||||
@@ -280,7 +280,7 @@ func (r *Rets) SetErrorCode() string {
|
||||
return r.useLongHandleErrorCode("r1")
|
||||
}
|
||||
if r.Type == "error" {
|
||||
return fmt.Sprintf(code, r.Name, windowsdot())
|
||||
return fmt.Sprintf(code, r.Name)
|
||||
}
|
||||
s := ""
|
||||
switch {
|
||||
|
||||
Reference in New Issue
Block a user