aboutsummaryrefslogtreecommitdiff
path: root/src/os/exec/exec_test.go
diff options
context:
space:
mode:
authorClément Chigot <clement.chigot@atos.net>2018-11-02 10:02:38 +0100
committerIan Lance Taylor <iant@golang.org>2018-11-02 13:43:23 +0000
commit5ee06f547122b7417b70ada55bb0d633e2094d88 (patch)
tree6f7c744636c9f54b875cc257a9a39c2ae2a8842b /src/os/exec/exec_test.go
parent56421f26ef8526427e034639510a162f3b40d825 (diff)
downloadgo-5ee06f547122b7417b70ada55bb0d633e2094d88.tar.gz
go-5ee06f547122b7417b70ada55bb0d633e2094d88.zip
internal/poll, os/exec, runtime: replace PollDescriptor by IsPollDescriptor
This commit changes poll.PollDescriptor by poll.IsPollDescriptor. This is needed for OS like AIX which have more than one FD using inside their netpoll implementation. Change-Id: I49e12a8d74045c501e19fdd8527cf166a3c64850 Reviewed-on: https://go-review.googlesource.com/c/146938 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/os/exec/exec_test.go')
-rw-r--r--src/os/exec/exec_test.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/os/exec/exec_test.go b/src/os/exec/exec_test.go
index 558345ff63..3e6b7bb95e 100644
--- a/src/os/exec/exec_test.go
+++ b/src/os/exec/exec_test.go
@@ -459,7 +459,7 @@ func basefds() uintptr {
// The poll (epoll/kqueue) descriptor can be numerically
// either between stderr and the testlog-fd, or after
// testlog-fd.
- if poll.PollDescriptor() == n {
+ if poll.IsPollDescriptor(n) {
n++
}
for _, arg := range os.Args {
@@ -472,7 +472,7 @@ func basefds() uintptr {
func closeUnexpectedFds(t *testing.T, m string) {
for fd := basefds(); fd <= 101; fd++ {
- if fd == poll.PollDescriptor() {
+ if poll.IsPollDescriptor(fd) {
continue
}
err := os.NewFile(fd, "").Close()
@@ -734,6 +734,8 @@ func TestHelperProcess(*testing.T) {
ofcmd = "fstat"
case "plan9":
ofcmd = "/bin/cat"
+ case "aix":
+ ofcmd = "procfiles"
}
args := os.Args
@@ -837,7 +839,7 @@ func TestHelperProcess(*testing.T) {
// Now verify that there are no other open fds.
var files []*os.File
for wantfd := basefds() + 1; wantfd <= 100; wantfd++ {
- if wantfd == poll.PollDescriptor() {
+ if poll.IsPollDescriptor(wantfd) {
continue
}
f, err := os.Open(os.Args[0])
@@ -851,6 +853,8 @@ func TestHelperProcess(*testing.T) {
switch runtime.GOOS {
case "plan9":
args = []string{fmt.Sprintf("/proc/%d/fd", os.Getpid())}
+ case "aix":
+ args = []string{fmt.Sprint(os.Getpid())}
default:
args = []string{"-p", fmt.Sprint(os.Getpid())}
}