From 48e94596afd6ad64d2e9e0619e9aa447de2a2666 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 29 Nov 2012 19:35:26 +0000 Subject: [PATCH] Add a forward declaration for shutdown_sockets. --- ncat/ncat_listen.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/ncat/ncat_listen.c b/ncat/ncat_listen.c index 193d8d684..4fd5b8cf7 100644 --- a/ncat/ncat_listen.c +++ b/ncat/ncat_listen.c @@ -146,6 +146,7 @@ static int read_stdin(void); static int read_socket(int recv_fd); static void post_handle_connection(struct fdinfo sinfo); static void read_and_broadcast(int recv_socket); +static void shutdown_sockets(int how); static int chat_announce_connect(int fd, const union sockaddr_u *su); static int chat_announce_disconnect(int fd); static char *chat_filter(char *buf, size_t size, int fd, int *nwritten); @@ -517,20 +518,6 @@ int read_stdin(void) return nbytes; } -void shutdown_sockets(int how) -{ - struct fdinfo *fdn; - int i; - - for (i = 0; i <= broadcast_fdlist.fdmax; i++) { - if (!FD_ISSET(i, &master_broadcastfds)) - continue; - - fdn = get_fdinfo(&broadcast_fdlist, i); - shutdown(fdn->fd, how); - } -} - /* Read from a client socket and write to stdout. Return the number of bytes read from the socket, or -1 on error. */ int read_socket(int recv_fd) @@ -938,6 +925,20 @@ static void read_and_broadcast(int recv_fd) } while (pending); } +static void shutdown_sockets(int how) +{ + struct fdinfo *fdn; + int i; + + for (i = 0; i <= broadcast_fdlist.fdmax; i++) { + if (!FD_ISSET(i, &master_broadcastfds)) + continue; + + fdn = get_fdinfo(&broadcast_fdlist, i); + shutdown(fdn->fd, how); + } +} + /* Announce the new connection and who is already connected. */ static int chat_announce_connect(int fd, const union sockaddr_u *su) {