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 package os
import ( import (
"error" "errors"
"syscall" "syscall"
) )

View file

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

View file

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

View file

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