mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-31 22:36:44 -04:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user