Skip to content

Commit

Permalink
123
Browse files Browse the repository at this point in the history
  • Loading branch information
nmoinvaz committed Dec 12, 2023
1 parent 7432ad6 commit ff04f3a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions net_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ static char *dns_resolve_filter(const char *host, int32_t family, uint8_t max_ad
// If no host supplied, then use local machine name
if (!host) {
err = gethostname(name, sizeof(name));
if (err != 0)
if (err != 0) {
printf("gethostname fail \n");
}
goto dns_resolve_error;
printf("gethostname: %s\n", name);
} else {
Expand All @@ -39,8 +41,10 @@ static char *dns_resolve_filter(const char *host, int32_t family, uint8_t max_ad
}

err = getaddrinfo(name, NULL, NULL, &address_info);
if (err != 0)
if (err != 0) {
printf("getaddr fail\n");
goto dns_resolve_error;
}

// Calculate the length of the return string
size_t max_ai_string = 1;
Expand Down

0 comments on commit ff04f3a

Please sign in to comment.