syscall: use error
- syscall (not os) now defines the Errno type.
- the low-level assembly functions Syscall, Syscall6, and so on
return Errno, not uintptr
- syscall wrappers all return error, not uintptr.
R=golang-dev, mikioh.mikioh, r, alex.brainman
CC=golang-dev
https://golang.org/cl/5372080
diff --git a/src/pkg/os/exec_unix.go b/src/pkg/os/exec_unix.go
index 242bda7..3dcac41 100644
--- a/src/pkg/os/exec_unix.go
+++ b/src/pkg/os/exec_unix.go
@@ -38,7 +38,7 @@
options ^= WRUSAGE
}
pid1, e := syscall.Wait4(p.Pid, &status, options, rusage)
- if e != 0 {
+ if e != nil {
return nil, NewSyscallError("wait", e)
}
// With WNOHANG pid is 0 if child has not exited.
@@ -57,8 +57,8 @@
if p.done {
return errors.New("os: process already finished")
}
- if e := syscall.Kill(p.Pid, int(sig.(UnixSignal))); e != 0 {
- return Errno(e)
+ if e := syscall.Kill(p.Pid, int(sig.(UnixSignal))); e != nil {
+ return e
}
return nil
}