mirror of
https://github.com/golang/go
synced 2024-11-02 11:50:30 +00:00
os, syscall: fix Plan 9 build
R=rsc CC=golang-dev https://golang.org/cl/5330067
This commit is contained in:
parent
f2b602ed42
commit
cabe0e6ad3
4 changed files with 6 additions and 5 deletions
|
@ -7,7 +7,7 @@
|
|||
package os
|
||||
|
||||
import (
|
||||
"error"
|
||||
"errors"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ func NewSyscallError(syscall string, err syscall.Error) error {
|
|||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
return &SyscallError{syscall, err.String()}
|
||||
return &SyscallError{syscall, err.Error()}
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
package os
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"runtime"
|
||||
"syscall"
|
||||
)
|
||||
|
@ -47,7 +48,7 @@ func (note Plan9Note) String() string {
|
|||
|
||||
func (p *Process) Signal(sig Signal) error {
|
||||
if p.done {
|
||||
return NewError("os: process already finished")
|
||||
return errors.New("os: process already finished")
|
||||
}
|
||||
|
||||
f, e := OpenFile("/proc/"+itoa(p.Pid)+"/note", O_WRONLY, 0)
|
||||
|
|
|
@ -19,13 +19,13 @@ const ImplementsGetwd = true
|
|||
|
||||
// An Error can represent any printable error condition.
|
||||
type Error interface {
|
||||
String() string
|
||||
error
|
||||
}
|
||||
|
||||
// ErrorString implements Error's String method by returning itself.
|
||||
type ErrorString string
|
||||
|
||||
func (e ErrorString) String() string { return string(e) }
|
||||
func (e ErrorString) Error() string { return string(e) }
|
||||
|
||||
// NewError converts s to an ErrorString, which satisfies the Error interface.
|
||||
func NewError(s string) Error { return ErrorString(s) }
|
||||
|
|
Loading…
Reference in a new issue