9 Commits

Author SHA1 Message Date
Russ Cox
b5fbb4746d all: gofmt
Gofmt to update doc comments to the new formatting.

For golang/go#51082.

Change-Id: I9a1c4b671c06820a1c383ee515f7884965fefa54
Reviewed-on: https://go-review.googlesource.com/c/sys/+/399602
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
2022-04-29 23:34:32 +00:00
Russ Cox
798191bca9 unix, plan9: avoid writing to p when Pipe(p) fails
Generally speaking Go functions make no guarantees
about what has happened to result parameters on error,
and Pipe is no exception: callers should avoid looking at
p if Pipe returns an error.

However, we had a bug in which ForkExec was using the
content of p after a failed Pipe, and others may too.
As a robustness fix, make Pipe avoid writing to p on failure.

windows.Pipe already avoided writing to p on failure.

For golang/go#50057.

Change-Id: I93ed06b06a9981793c119c1d7df689fbe79b4116
Reviewed-on: https://go-review.googlesource.com/c/sys/+/370614
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-09 17:19:07 +00:00
Tobias Klauser
7dca6fe1f4 plan9: use bytes.IndexByte instead of a for loop
Change-Id: Iae896dc32e775cb469fc3d0d367fd7c7825161ec
Reviewed-on: https://go-review.googlesource.com/99516
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-03-08 15:20:46 +00:00
David du Colombier
7353fe07c1 plan9: make pwd process-wide on Plan 9
From main repo: https://go-review.googlesource.com/#/c/6350
                https://go-review.googlesource.com/#/c/6385

Change-Id: Ieba5ff60fc501be9aa4739860c8fe026f8b3eb67
Reviewed-on: https://go-review.googlesource.com/8721
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-04-12 18:03:11 +00:00
David du Colombier
d3c664b24d plan9: reduce the set of architecture-dependent files on Plan 9
From main repo: https://go-review.googlesource.com/#/c/2167

Change-Id: I2043458a432ccd2aa8b206adc107ac7b215e355f
Reviewed-on: https://go-review.googlesource.com/8720
Reviewed-by: Rob Pike <r@golang.org>
2015-04-11 10:39:11 +00:00
David du Colombier
02c66d5dc9 go.sys/plan9: use syscall.ErrorString instead of NewError
LGTM=bradfitz, r
R=r, bradfitz
CC=golang-codereviews
https://golang.org/cl/126090044
2014-08-25 02:23:33 +02:00
Rob Pike
b87d025ac4 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
2014-08-14 09:29:35 -07:00
Rob Pike
8442dd2c63 go.sys: update package names
Semi-automatic migration from package syscall to package {plan9,windows,unix}.
No builds attempted yet, but this gets a lot of noise behind us so subsequent
CLs will be more concise and easier to follow.
Subsequent CLs will have semantic content.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/121520043
2014-08-11 15:58:26 -07:00
Rob Pike
20acc5cf31 go.sys: copy files from syscall package to go.sys/{plan9,windows,unix}
This CL copies to each package of go.sys the files from syscall it will need.
Different directories have different files, but these:
        mkall.sh
        str.go
        syscall.go
        mksyscall.pl
        race.go
        race0.go
        syscall_test.go
are copied to all three.
No changes yet, these are just copies. They are not ready to use yet:
package names are wrong, for starters. But this clean copy will make
it easier to follow the changes as the packages are enabled.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/126960043
2014-08-11 14:48:46 -07:00