We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f5b7418 commit 5b63f35Copy full SHA for 5b63f35
core/iwasm/libraries/lib-socket/test/nslookup.c
@@ -4,6 +4,7 @@
4
*/
5
6
#include <assert.h>
7
+#include <errno.h>
8
#include <string.h>
9
#include <stdio.h>
10
#include <pthread.h>
@@ -28,6 +29,15 @@ test_nslookup(int af)
28
29
hints.ai_family = af;
30
hints.ai_socktype = SOCK_STREAM;
31
int ret = getaddrinfo(url, 0, &hints, &res);
32
+ if (ret != 0) {
33
+ if (ret == EAI_SYSTEM) {
34
+ fprintf(stderr, "getaddrinfo failed: %s (%s)\n", gai_strerror(ret),
35
+ strerror(errno));
36
+ }
37
+ else {
38
+ fprintf(stderr, "getaddrinfo failed: %s\n", gai_strerror(ret));
39
40
41
assert(ret == 0);
42
struct addrinfo *address = res;
43
while (address) {
0 commit comments