From 5cca544e59f53df7c87eb060b348461300f8fd5f Mon Sep 17 00:00:00 2001 From: Nick Krichevsky Date: Sun, 9 Sep 2018 19:51:51 -0400 Subject: [PATCH] Add errno print on server failure --- server/http_server.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/http_server.c b/server/http_server.c index 72cff44..92d929f 100644 --- a/server/http_server.c +++ b/server/http_server.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -17,6 +18,9 @@ int main(int argc, char* argv[]) { printf("%s", PORT_ERROR); } struct server_info info = setup(port_num); + if (info.status == STATUS_ERROR) { + printf("%s\n", strerror(errno)); + } serve_one_request(info.sock_fd); shutdown(info.sock_fd, SHUT_RDWR); close(info.sock_fd);