aboutsummaryrefslogtreecommitdiffstats
path: root/src/blogc-runserver/httpd.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2017-03-05 04:19:42 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2017-03-05 04:19:42 +0100
commitbcf25eb9180a4ce17b44a8ae06a5e36446471668 (patch)
treea7213fa48c4804e506caa0030a67e0890b7320b3 /src/blogc-runserver/httpd.c
parent1b5d45cec7233fd82f26ac4bc7f5f44886aabe59 (diff)
downloadblogc-bcf25eb9180a4ce17b44a8ae06a5e36446471668.tar.gz
blogc-bcf25eb9180a4ce17b44a8ae06a5e36446471668.tar.bz2
blogc-bcf25eb9180a4ce17b44a8ae06a5e36446471668.zip
runserver: close socket if skipped
Diffstat (limited to 'src/blogc-runserver/httpd.c')
-rw-r--r--src/blogc-runserver/httpd.c1
1 files changed, 1 insertions, 0 deletions
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)) {