diff options
| author | 2022-09-03 20:48:02 +0100 | |
|---|---|---|
| committer | 2022-09-03 20:48:02 +0100 | |
| commit | ab8202da3ca0bc9a741bee337cccccaff45b6eb9 (patch) | |
| tree | 2b0bbd5a091a77a461d8af3aefbced4cecbe311d /src | |
| parent | Initialize some variables inline instead of in the constructor. (diff) | |
Fix another case of `fd < 0` instead of calling HasFd.
Diffstat (limited to 'src')
| -rw-r--r-- | src/socketengines/kqueue.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/socketengines/kqueue.cpp b/src/socketengines/kqueue.cpp index f5383de00..2114e9652 100644 --- a/src/socketengines/kqueue.cpp +++ b/src/socketengines/kqueue.cpp @@ -182,14 +182,11 @@ int SocketEngine::DispatchEvents() // This can't be a static_cast because udata is intptr_t on NetBSD. struct kevent& kev = ke_list[j]; EventHandler* eh = reinterpret_cast<EventHandler*>(kev.udata); - if (!eh) + if (!eh || !eh->HasFd()) continue; - // Copy these in case the vector gets resized and kev invalidated - const int fd = eh->GetFd(); + // Copy this in case the vector gets resized and kev invalidated const short filter = kev.filter; - if (fd < 0) - continue; if (kev.flags & EV_EOF) { |
