Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 267629
b: refs/heads/master
c: 5be528c
h: refs/heads/master
i:
  267627: 4effcb2
v: v3
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Aug 23, 2011
1 parent aa6bd4a commit 4b80995
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e54bbc6471d7f788d829e5f3b5922960048fbff7
refs/heads/master: 5be528c2130a1281ba858296924dd619068bb0e3
8 changes: 3 additions & 5 deletions trunk/drivers/staging/hv/tools/hv_kvp_daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,22 +273,20 @@ static int
kvp_get_domain_name(char *buffer, int length)
{
struct addrinfo hints, *info ;
gethostname(buffer, length);
int error = 0;

gethostname(buffer, length);
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_INET; /*Get only ipv4 addrinfo. */
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_CANONNAME;

error = getaddrinfo(buffer, "http", &hints, &info);
error = getaddrinfo(buffer, NULL, &hints, &info);
if (error != 0) {
strcpy(buffer, "getaddrinfo failed\n");
error = 1;
goto get_domain_done;
return error;
}
strcpy(buffer, info->ai_canonname);
get_domain_done:
freeaddrinfo(info);
return error;
}
Expand Down

0 comments on commit 4b80995

Please sign in to comment.