From bcf25eb9180a4ce17b44a8ae06a5e36446471668 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Sun, 5 Mar 2017 04:19:42 +0100 Subject: runserver: close socket if skipped --- src/blogc-runserver/httpd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/blogc-runserver/httpd.c b/src/blogc-runserver/httpd.c index 4afb2b8..1c20d43 100644 --- a/src/blogc-runserver/httpd.c +++ b/src/blogc-runserver/httpd.c @@ -272,6 +272,7 @@ br_httpd_run(const char *host, const char *port, const char *docroot, } int value = 1; if (0 > setsockopt(server_socket, SOL_SOCKET, SO_REUSEADDR, &value, sizeof(int))) { + close(server_socket); continue; } if (0 == bind(server_socket, rp->ai_addr, rp->ai_addrlen)) { -- cgit v1.2.3-18-g5258