summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index e90bbb7..4c3298b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -9,20 +9,17 @@
int establish_connection(struct sockaddr_in addr) {
int sfd = socket(AF_INET, SOCK_STREAM, 0);
if (sfd == -1) {
- perror("could not open socket");
return -1;
}
int opt = -1;
setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
int bind_addr = bind(sfd, (struct sockaddr *)&addr, sizeof(addr));
if (bind_addr == -1) {
- perror("could not bind socket");
close(sfd);
return -1;
}
int listen_addr = listen(sfd, 100);
if (listen_addr == -1) {
- perror("could not listen");
close(sfd);
return -1;
}