From 1e6a829cbcb3a308bf78be8714e6c2a10fcf3248 Mon Sep 17 00:00:00 2001 From: cashmere Date: Tue, 30 Jun 2026 23:28:01 +0200 Subject: src/main.c: include struct client into `process_message` --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 761ef9b..97d9f18 100644 --- a/src/main.c +++ b/src/main.c @@ -48,7 +48,7 @@ int handle_new_connection(int sfd, struct pollfd *fds, nfds_t *nfds, // process message to all the connected clients. // returns 0 on success and -1 on failure. // TODO: add struct client *clients -int process_message(struct pollfd *fds, nfds_t *nfds) { +int process_message(struct pollfd *fds, nfds_t *nfds, struct client *clients) { for (nfds_t i = 1; i < *nfds; i++) { /* if client has something to say */ if (fds[i].revents & POLLIN) { @@ -112,7 +112,7 @@ int main() { continue; } } - if (process_message(fds, &nfds) == -1) { + if (process_message(fds, &nfds, clients) == -1) { perror("could not process message"); continue; } -- cgit v1.3.1