go.sys/plan9: use syscall.ErrorString for errors

If we use a local type, it won't compare properly with errors from
the rest of the standard library. Errors are the one type from syscall
that propagates through the system, so it's important to have only
one type for them.
Will apply the corresponding change to the other packages once
this is approved.

Also delete some deprecated code. This is a new package; no need
to carry the past.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/126250043
This commit is contained in:
Rob Pike
2014-08-14 09:29:35 -07:00
parent 0c07981137
commit b87d025ac4
3 changed files with 9 additions and 56 deletions
-17
View File
@@ -61,18 +61,6 @@ import (
var ForkLock sync.RWMutex
// StringSlicePtr is deprecated. Use SlicePtrFromStrings instead.
// If any string contains a NUL byte this function panics instead
// of returning an error.
func StringSlicePtr(ss []string) []*byte {
bb := make([]*byte, len(ss)+1)
for i := 0; i < len(ss); i++ {
bb[i] = StringBytePtr(ss[i])
}
bb[len(ss)] = nil
return bb
}
// SlicePtrFromStrings converts a slice of strings to a slice of
// pointers to NUL-terminated byte slices. If any string contains
// a NUL byte, it returns (nil, EINVAL).
@@ -323,11 +311,6 @@ childerror:
for {
RawSyscall(SYS_EXITS, 0, 0, 0)
}
// Calling panic is not actually safe,
// but the for loop above won't break
// and this shuts up the compiler.
panic("unreached")
}
func cexecPipe(p []int) error {