Skip to content

Commit b712255

Browse files
committed
poll: fix handling for eventport unfired oneshot events
1 parent e168f07 commit b712255

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

main/poll/poll_backend_eventport.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -312,21 +312,21 @@ static int eventport_backend_wait(
312312
/* Get entry and handle re-association */
313313
php_poll_fd_entry *entry = php_poll_fd_table_find(backend_data->fd_table, fd);
314314
if (entry) {
315+
/* Check if there are other events we're monitoring */
316+
uint32_t monitored = entry->events & (PHP_POLL_READ | PHP_POLL_WRITE);
317+
uint32_t unfired = monitored & ~fired;
318+
319+
if (unfired) {
320+
/* Store unfired events for potential second-round check */
321+
events[i].events = unfired;
322+
check_count++;
323+
}
324+
315325
if (entry->events & PHP_POLL_ONESHOT) {
316326
/* Oneshot: remove from tracking */
317327
php_poll_fd_table_remove(backend_data->fd_table, fd);
318328
backend_data->active_associations--;
319329
} else {
320-
/* Check if there are other events we're monitoring */
321-
uint32_t monitored = entry->events & (PHP_POLL_READ | PHP_POLL_WRITE);
322-
uint32_t unfired = monitored & ~fired;
323-
324-
if (unfired) {
325-
/* Store unfired events for potential second-round check */
326-
events[i].events = unfired;
327-
check_count++;
328-
}
329-
330330
/* Re-associate immediately with all originally registered events */
331331
int native_events = eventport_events_to_native(entry->events);
332332
if (port_associate(backend_data->port_fd, PORT_SOURCE_FD, fd, native_events,

0 commit comments

Comments
 (0)