Add errno print on server failure
parent
28700e2e63
commit
5cca544e59
|
@ -4,6 +4,7 @@
|
|||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/socket.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue