From 18dfb483a2db33af7257b887234b515c0c733b8a Mon Sep 17 00:00:00 2001 From: Edoardo Vacchi Date: Fri, 28 Jul 2023 09:06:49 +0200 Subject: [PATCH] Remove pollWithContext (dead code) Signed-off-by: Edoardo Vacchi --- internal/sysfs/poll_windows.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/internal/sysfs/poll_windows.go b/internal/sysfs/poll_windows.go index 44fbf123bb1..4cc85f21a84 100644 --- a/internal/sysfs/poll_windows.go +++ b/internal/sysfs/poll_windows.go @@ -1,7 +1,6 @@ package sysfs import ( - "context" "syscall" "time" "unsafe" @@ -43,11 +42,6 @@ const pollInterval = 100 * time.Millisecond // poll implements poll on Windows, for a subset of cases. // -// This internally invokes pollWithContext with a default context. -func poll(fds []pollFd, timeoutMillis int32) (n int, errno sys.Errno) { - return pollWithContext(context.TODO(), fds, timeoutMillis) -} - // pollWithContext emulates the behavior of POSIX poll(2) on Windows, for a subset of cases, // and it supports context cancellation. // @@ -64,7 +58,7 @@ func poll(fds []pollFd, timeoutMillis int32) (n int, errno sys.Errno) { // // The duration may be negative, in which case it will wait indefinitely. The given ctx is // used to allow for cancellation, and it is currently used only in tests. -func pollWithContext(ctx context.Context, fds []pollFd, timeoutMillis int32) (n int, errno sys.Errno) { +func poll(fds []pollFd, timeoutMillis int32) (n int, errno sys.Errno) { if fds == nil { return -1, sys.ENOSYS } @@ -101,8 +95,6 @@ func pollWithContext(ctx context.Context, fds []pollFd, timeoutMillis int32) (n for { select { - case <-ctx.Done(): - return 0, 0 case <-afterCh: return 0, 0 case <-tickCh: