Skip to content

Commit

Permalink
Fix pointer usage in kqueue implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Oct 24, 2023
1 parent 63fd475 commit 754807c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions ext/io/event/selector/kqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -914,25 +914,25 @@ VALUE select_handle_events(VALUE _arguments)
struct select_arguments *arguments = (struct select_arguments *)_arguments;
struct IO_Event_Selector_KQueue *selector = arguments->selector;

for (int i = 0; i < arguments.count; i += 1) {
if (arguments.events[i].udata) {
struct IO_Event_Selector_KQueue_Descriptor *kqueue_descriptor = arguments.events[i].udata;
kqueue_descriptor->ready_events |= events_from_kevent_filter(arguments.events[i].filter);
for (int i = 0; i < arguments->count; i += 1) {
if (arguments->events[i].udata) {
struct IO_Event_Selector_KQueue_Descriptor *kqueue_descriptor = arguments->events[i].udata;
kqueue_descriptor->ready_events |= events_from_kevent_filter(arguments->events[i].filter);
}
}

for (int i = 0; i < arguments.count; i += 1) {
if (arguments.events[i].udata) {
struct IO_Event_Selector_KQueue_Descriptor *kqueue_descriptor = arguments.events[i].udata;
IO_Event_Selector_KQueue_handle(selector, arguments.events[i].ident, kqueue_descriptor, &arguments.saved);
for (int i = 0; i < arguments->count; i += 1) {
if (arguments->events[i].udata) {
struct IO_Event_Selector_KQueue_Descriptor *kqueue_descriptor = arguments->events[i].udata;
IO_Event_Selector_KQueue_handle(selector, arguments->events[i].ident, kqueue_descriptor, &arguments.saved);
} else {
#ifdef IO_EVENT_SELECTOR_KQUEUE_USE_INTERRUPT
IO_Event_Interrupt_clear(&selector->interrupt);
#endif
}
}

return RB_INT2NUM(arguments.count);
return RB_INT2NUM(arguments->count);
}

static
Expand Down

0 comments on commit 754807c

Please sign in to comment.