on master help sign in
Merge pull request #4015 from melted/fix_net_2
82114d1Niklas Larsson
rts/idris_net.c+3−3
@@ -65,7 +65,7 @@ int idrnet_getaddrinfo(struct addrinfo** address_res, char* host, int port,
65int idrnet_bind(int sockfd, int family, int socket_type, char* host, int port) {
65int idrnet_bind(int sockfd, int family, int socket_type, char* host, int port) {
66 struct addrinfo* address_res;
66 struct addrinfo* address_res;
67 int addr_res = idrnet_getaddrinfo(&address_res, host, port, family, socket_type);
67 int addr_res = idrnet_getaddrinfo(&address_res, host, port, family, socket_type);
68− if (addr_res == -1) {
68+ if (addr_res != 0) {
69 //printf("Lib err: bind getaddrinfo\n");
69 //printf("Lib err: bind getaddrinfo\n");
70 return -1;
70 return -1;
71 }
71 }
@@ -189,7 +189,7 @@ int idrnet_sendto(int sockfd, char* data, char* host, int port, int family) {
189
189
190 struct addrinfo* remote_host;
190 struct addrinfo* remote_host;
191 int addr_res = idrnet_getaddrinfo(&remote_host, host, port, family, SOCK_DGRAM);
191 int addr_res = idrnet_getaddrinfo(&remote_host, host, port, family, SOCK_DGRAM);
192− if (addr_res == -1) {
192+ if (addr_res != 0) {
193 return -1;
193 return -1;
194 }
194 }
195
195
@@ -203,7 +203,7 @@ int idrnet_sendto_buf(int sockfd, void* buf, int buf_len, char* host, int port,
203
203
204 struct addrinfo* remote_host;
204 struct addrinfo* remote_host;
205 int addr_res = idrnet_getaddrinfo(&remote_host, host, port, family, SOCK_DGRAM);
205 int addr_res = idrnet_getaddrinfo(&remote_host, host, port, family, SOCK_DGRAM);
206− if (addr_res == -1) {
206+ if (addr_res != 0) {
207 //printf("lib err: sendto getaddrinfo \n");
207 //printf("lib err: sendto getaddrinfo \n");
208 return -1;
208 return -1;
209 }
209 }
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
94
94
95 // Get info about the remote host (DNS lookup etc)
95 // Get info about the remote host (DNS lookup etc)
96 int addr_res = getaddrinfo(host, str_port, &hints, &remote_host);
96 int addr_res = getaddrinfo(host, str_port, &hints, &remote_host);
97− if (addr_res == -1) {
97+ if (addr_res != 0) {
98 return -1;
98 return -1;
99 }
99 }
100
100