aboutsummaryrefslogtreecommitdiffstats
path: root/irc.c
diff options
context:
space:
mode:
Diffstat (limited to 'irc.c')
-rw-r--r--irc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/irc.c b/irc.c
index 5832421..f4ec697 100644
--- a/irc.c
+++ b/irc.c
@@ -6,6 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include "irc.h"
@@ -25,7 +26,7 @@ static int tcp_connect(const char *host, int port)
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
memcpy(&addr.sin_addr, h->h_addr, h->h_length);
- if (connect(sock, (struct sockaddr *) &addr,
+ if (connect(sock, (struct sockaddr *) &addr,
sizeof(struct sockaddr_in))) {
close(sock);
sock = -1;
@@ -84,4 +85,5 @@ int irc_close(struct irc_session *s, const char *msg)
close(s->fd);
}
free(s);
+ return 0;
}