From 0fe88e9419a41d3158869f3c9e98d08e6a84dbee Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Wed, 13 Dec 2023 19:54:50 +0100 Subject: Reformatted net_flush_all_connections() --- FICS/network.c | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) (limited to 'FICS/network.c') diff --git a/FICS/network.c b/FICS/network.c index de9d99c..be8a8ae 100644 --- a/FICS/network.c +++ b/FICS/network.c @@ -134,25 +134,30 @@ PRIVATE void net_flushme(int which) } } -PRIVATE void net_flush_all_connections(void) +PRIVATE void +net_flush_all_connections(void) { - int which; - fd_set writefds; - struct timeval to; - - FD_ZERO(&writefds); - for (which = 0; which < MAX_PLAYER; which++) - if (con[which].status == NETSTAT_CONNECTED && con[which].sndbufpos) - FD_SET(con[which].outFd, &writefds); - - to.tv_usec = 0; - to.tv_sec = 0; - select(no_file, NULL, &writefds, NULL, &to); - for (which = 0; which < MAX_PLAYER; which++) { - if (FD_ISSET(con[which].outFd, &writefds)) { - net_flushme(which); - } - } + fd_set writefds; + int which; + struct timeval to; + + FD_ZERO(&writefds); + + for (which = 0; which < MAX_PLAYER; which++) { + if (con[which].status == NETSTAT_CONNECTED && + con[which].sndbufpos) + FD_SET(con[which].outFd, &writefds); + } + + to.tv_usec = 0; + to.tv_sec = 0; + + select(no_file, NULL, &writefds, NULL, &to); + + for (which = 0; which < MAX_PLAYER; which++) { + if (FD_ISSET(con[which].outFd, &writefds)) + net_flushme(which); + } } PRIVATE void -- cgit v1.2.3