mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-03 23:57:32 -04:00
go.sys/unix: use syscall.Errno for 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. Ditto for syscall.Signal. LGTM=dave R=rsc, dave CC=golang-codereviews https://golang.org/cl/123490043
This commit is contained in:
+3
-2
@@ -8,6 +8,7 @@ package unix
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
@@ -34,12 +35,12 @@ func runtime_AfterFork()
|
||||
// For the same reason compiler does not race instrument it.
|
||||
// The calls to RawSyscall are okay because they are assembly
|
||||
// functions that do not grow the stack.
|
||||
func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr *ProcAttr, sys *SysProcAttr, pipe int) (pid int, err Errno) {
|
||||
func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr *ProcAttr, sys *SysProcAttr, pipe int) (pid int, err syscall.Errno) {
|
||||
// Declare all variables at top in case any
|
||||
// declarations require heap allocation (e.g., err1).
|
||||
var (
|
||||
r1, r2 uintptr
|
||||
err1 Errno
|
||||
err1 syscall.Errno
|
||||
nextfd int
|
||||
i int
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user