mirror of
https://github.com/golang/go.git
synced 2025-11-07 20:21:01 +00:00
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
This commit is contained in:
parent
b126902e84
commit
c017a8299f
102 changed files with 7429 additions and 5975 deletions
|
|
@ -38,7 +38,7 @@ func (p *Process) Wait(options int) (w *Waitmsg, err error) {
|
|||
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 @@ func (p *Process) Signal(sig Signal) error {
|
|||
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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue