From 3e48720fad7af678a1e35cfc259a31db444d74db Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 21 Jan 2021 02:26:53 +0000 Subject: [PATCH] Close listening sockets when done --- discardd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/discardd.c b/discardd.c index fd2d51e..9d83c6e 100644 --- a/discardd.c +++ b/discardd.c @@ -97,8 +97,12 @@ handle_tcp(const char *port) { int s[8]; size_t nsocks = nelems(s); + size_t i; listen_sock_setup(port, SOCK_STREAM, s, &nsocks); + + for (i = 0; i < nsocks; i++) + close(s[i]); } static void