mirror of
https://github.com/golang/sys.git
synced 2026-02-08 03:36:03 +03:00
unix: fix EINTR check in TestPselect
err == EINTR needs to be checked before err != nil for the interrupted syscall to be retried properly. Follow-up for CL 207284 Updates golang/go#35555 Change-Id: I76d569058b7985ec51f07909d86807a8b4911772 Reviewed-on: https://go-review.googlesource.com/c/sys/+/207292 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
committed by
Tobias Klauser
parent
cf1e2d5771
commit
e882bf8e40
@@ -289,11 +289,11 @@ func TestSelect(t *testing.T) {
|
||||
func TestPselect(t *testing.T) {
|
||||
for {
|
||||
_, err := unix.Pselect(0, nil, nil, nil, &unix.Timespec{Sec: 0, Nsec: 0}, nil)
|
||||
if err != nil {
|
||||
t.Fatalf("Pselect: %v", err)
|
||||
} else if err == unix.EINTR {
|
||||
if err == unix.EINTR {
|
||||
t.Logf("Pselect interrupted")
|
||||
continue
|
||||
} else if err != nil {
|
||||
t.Fatalf("Pselect: %v", err)
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user