From 7f98c0eb031d678687a3c07f5e1f11cac12d4171 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 22 Oct 2019 00:54:22 -0700 Subject: [PATCH] os/exec: skip possible netpoll pipe in known FDs in test Fixes #35045 Change-Id: I90ac29882c7d03936c98c4116a8bccdd2ecbf76b Reviewed-on: https://go-review.googlesource.com/c/go/+/202445 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Tobias Klauser --- src/os/exec/exec_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/os/exec/exec_test.go b/src/os/exec/exec_test.go index 60a8d0228b3..19d2111743e 100644 --- a/src/os/exec/exec_test.go +++ b/src/os/exec/exec_test.go @@ -453,13 +453,13 @@ var testedAlreadyLeaked = false // basefds returns the number of expected file descriptors // to be present in a process at start. -// stdin, stdout, stderr, epoll/kqueue, maybe testlog +// stdin, stdout, stderr, epoll/kqueue, epoll/kqueue pipe, maybe testlog func basefds() uintptr { n := os.Stderr.Fd() + 1 // The poll (epoll/kqueue) descriptor can be numerically // either between stderr and the testlog-fd, or after // testlog-fd. - if poll.IsPollDescriptor(n) { + for poll.IsPollDescriptor(n) { n++ } for _, arg := range os.Args {