summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/main.c b/main.c
index 8f1d3ef..c1a7c30 100644
--- a/main.c
+++ b/main.c
@@ -254,7 +254,7 @@ static int serve(int server_fd)
254} 254}
255 255
256int main(const int argc, char const * argv[]) { 256int main(const int argc, char const * argv[]) {
257 int server_fd = -1, opt = 1; 257 int server_fd = -1;
258 258
259 int port = atoi(argc > 1 ? argv[1] : "8080"); 259 int port = atoi(argc > 1 ? argv[1] : "8080");
260 0 == port ? port = 8080 : port; 260 0 == port ? port = 8080 : port;
@@ -269,8 +269,6 @@ int main(const int argc, char const * argv[]) {
269 // I <3 C 269 // I <3 C
270 0 == (server_fd = socket(AF_INET, SOCK_STREAM, 0)) 270 0 == (server_fd = socket(AF_INET, SOCK_STREAM, 0))
271 ? err(errno, NULL) 271 ? err(errno, NULL)
272 : setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR | SO_REUSEPORT, &opt, sizeof(opt))
273 ? err(errno, "setsockopt failed on socket with fileno %d", server_fd)
274 : bind(server_fd, (struct sockaddr*) &address, sizeof(address)) 272 : bind(server_fd, (struct sockaddr*) &address, sizeof(address))
275 ? err(errno, NULL) 273 ? err(errno, NULL)
276 : listen(server_fd, SOMAXCONN) 274 : listen(server_fd, SOMAXCONN)
..