diff --git a/src/event/PollGroupWinSelect.cxx b/src/event/PollGroupWinSelect.cxx index d92656daa..0615d6051 100644 --- a/src/event/PollGroupWinSelect.cxx +++ b/src/event/PollGroupWinSelect.cxx @@ -142,9 +142,9 @@ PollGroupWinSelect::ReadEvents(PollResultGeneric &result, } int ret = select(0, - read_set.IsEmpty() ? nullptr : read_set.GetPtr(), - write_set.IsEmpty() ? nullptr : write_set.GetPtr(), - except_set.IsEmpty() ? nullptr : except_set.GetPtr(), + read_set.GetPtr(), + write_set.GetPtr(), + except_set.GetPtr(), timeout_ms < 0 ? nullptr : &tv); if (ret == 0 || ret == SOCKET_ERROR) diff --git a/src/event/PollGroupWinSelect.hxx b/src/event/PollGroupWinSelect.hxx index 6ec9eac82..a296f8ce7 100644 --- a/src/event/PollGroupWinSelect.hxx +++ b/src/event/PollGroupWinSelect.hxx @@ -52,7 +52,7 @@ public: } fd_set *GetPtr() noexcept { - return &set; + return IsEmpty() ? nullptr : &set; } size_t Size() const noexcept {