diff --git a/unix/syscall_linux_test.go b/unix/syscall_linux_test.go index cc3af9f6..7d9c8a16 100644 --- a/unix/syscall_linux_test.go +++ b/unix/syscall_linux_test.go @@ -239,13 +239,16 @@ func TestRlimitAs(t *testing.T) { func TestPselect(t *testing.T) { for { - _, err := unix.Pselect(0, nil, nil, nil, &unix.Timespec{Sec: 0, Nsec: 0}, nil) + n, err := unix.Pselect(0, nil, nil, nil, &unix.Timespec{Sec: 0, Nsec: 0}, nil) if err == unix.EINTR { t.Logf("Pselect interrupted") continue } else if err != nil { t.Fatalf("Pselect: %v", err) } + if n != 0 { + t.Fatalf("Pselect: got %v ready file descriptors, expected 0", n) + } break } @@ -254,7 +257,7 @@ func TestPselect(t *testing.T) { var took time.Duration for { start := time.Now() - _, err := unix.Pselect(0, nil, nil, nil, &ts, nil) + n, err := unix.Pselect(0, nil, nil, nil, &ts, nil) took = time.Since(start) if err == unix.EINTR { t.Logf("Pselect interrupted after %v", took) @@ -262,6 +265,9 @@ func TestPselect(t *testing.T) { } else if err != nil { t.Fatalf("Pselect: %v", err) } + if n != 0 { + t.Fatalf("Pselect: got %v ready file descriptors, expected 0", n) + } break }