1
0
mirror of https://github.com/golang/go synced 2024-11-12 00:30:22 -07:00

os, syscall: fix Plan 9 build

R=rsc
CC=golang-dev
https://golang.org/cl/5330067
This commit is contained in:
Anthony Martin 2011-11-08 09:06:02 -05:00 committed by Russ Cox
parent f2b602ed42
commit cabe0e6ad3
4 changed files with 6 additions and 5 deletions

View File

@ -7,7 +7,7 @@
package os
import (
"error"
"errors"
"syscall"
)

View File

@ -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 (

View File

@ -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)

View File

@ -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) }