From 5b58c9fd2880911aa926259d97a396e97f3d4313 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 13 Jun 2023 01:50:24 +0200 Subject: event_loop: hide the API details --- src/command.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/command.c') diff --git a/src/command.c b/src/command.c index 6306f7e..f629fde 100644 --- a/src/command.c +++ b/src/command.c @@ -222,14 +222,8 @@ free_ctx: return ret; } -int cmd_dispatcher_add_to_event_loop(const struct cmd_dispatcher *dispatcher, - struct event_loop *loop, int fd) +int cmd_dispatcher_add_to_event_loop(struct cmd_dispatcher *dispatcher, struct event_loop *loop, + int fd) { - struct event_fd entry = { - .fd = fd, - .events = POLLIN, - .handler = cmd_dispatcher_handle_event, - .arg = (void *)dispatcher, - }; - return event_loop_add(loop, &entry); + return event_loop_add(loop, fd, POLLIN, cmd_dispatcher_handle_event, dispatcher); } -- cgit v1.2.3