on master help sign in
Merge pull request #4015 from melted/fix_net_2

Fix more places were getaddrinfo is used

commit82114d1d202b7c3ac87f8a1c39b8287873017fa7 authorNiklas Larsson <metaniklas@gmail.com> dateWed 23 Aug 2017, 00:45 (9 years ago) parent916111b2410405
2 files changed+4−4
rts/idris_net.c+3−3 rts/windows/idris_net.c+1−1
rts/idris_net.c+3−3
@@ -65,7 +65,7 @@ int idrnet_getaddrinfo(struct addrinfo** address_res, char* host, int port,
6565int idrnet_bind(int sockfd, int family, int socket_type, char* host, int port) {
6666 struct addrinfo* address_res;
6767 int addr_res = idrnet_getaddrinfo(&address_res, host, port, family, socket_type);
68− if (addr_res == -1) {
68+ if (addr_res != 0) {
6969 //printf("Lib err: bind getaddrinfo\n");
7070 return -1;
7171 }
@@ -189,7 +189,7 @@ int idrnet_sendto(int sockfd, char* data, char* host, int port, int family) {
189189
190190 struct addrinfo* remote_host;
191191 int addr_res = idrnet_getaddrinfo(&remote_host, host, port, family, SOCK_DGRAM);
192− if (addr_res == -1) {
192+ if (addr_res != 0) {
193193 return -1;
194194 }
195195
@@ -203,7 +203,7 @@ int idrnet_sendto_buf(int sockfd, void* buf, int buf_len, char* host, int port,
203203
204204 struct addrinfo* remote_host;
205205 int addr_res = idrnet_getaddrinfo(&remote_host, host, port, family, SOCK_DGRAM);
206− if (addr_res == -1) {
206+ if (addr_res != 0) {
207207 //printf("lib err: sendto getaddrinfo \n");
208208 return -1;
209209 }
rts/windows/idris_net.c+1−1
@@ -94,7 +94,7 @@ int idrnet_connect(int sockfd, int family, int socket_type, char* host, int port
9494
9595 // Get info about the remote host (DNS lookup etc)
9696 int addr_res = getaddrinfo(host, str_port, &hints, &remote_host);
97− if (addr_res == -1) {
97+ if (addr_res != 0) {
9898 return -1;
9999 }
100100