mirror of
https://github.com/golang/go
synced 2024-11-25 13:57:57 -07: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
@ -7,7 +7,7 @@
|
|||||||
package os
|
package os
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"error"
|
"errors"
|
||||||
"syscall"
|
"syscall"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ func NewSyscallError(syscall string, err syscall.Error) error {
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return &SyscallError{syscall, err.String()}
|
return &SyscallError{syscall, err.Error()}
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
package os
|
package os
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"runtime"
|
"runtime"
|
||||||
"syscall"
|
"syscall"
|
||||||
)
|
)
|
||||||
@ -47,7 +48,7 @@ func (note Plan9Note) String() string {
|
|||||||
|
|
||||||
func (p *Process) Signal(sig Signal) error {
|
func (p *Process) Signal(sig Signal) error {
|
||||||
if p.done {
|
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)
|
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.
|
// An Error can represent any printable error condition.
|
||||||
type Error interface {
|
type Error interface {
|
||||||
String() string
|
error
|
||||||
}
|
}
|
||||||
|
|
||||||
// ErrorString implements Error's String method by returning itself.
|
// ErrorString implements Error's String method by returning itself.
|
||||||
type ErrorString string
|
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.
|
// NewError converts s to an ErrorString, which satisfies the Error interface.
|
||||||
func NewError(s string) Error { return ErrorString(s) }
|
func NewError(s string) Error { return ErrorString(s) }
|
||||||
|
Loading…
Reference in New Issue
Block a user