ws2_32: Fix edge case for getaddrinfo in BSD and OSX.
This commit is contained in:
parent
5425cb3413
commit
da16d6b660
|
@ -5466,6 +5466,9 @@ int WINAPI WS_getaddrinfo(LPCSTR nodename, LPCSTR servname, const struct WS_addr
|
|||
else
|
||||
node = nodename;
|
||||
|
||||
/* servname tweak required by OSX and BSD kernels */
|
||||
if (servname && !servname[0]) servname = "0";
|
||||
|
||||
if (hints) {
|
||||
punixhints = &unixhints;
|
||||
|
||||
|
|
|
@ -5401,12 +5401,24 @@ static void test_GetAddrInfoW(void)
|
|||
ok(result != NULL, "GetAddrInfoW failed\n");
|
||||
pFreeAddrInfoW(result);
|
||||
|
||||
result = NULL;
|
||||
ret = pGetAddrInfoW(NULL, empty, NULL, &result);
|
||||
ok(!ret, "GetAddrInfoW failed with %d\n", WSAGetLastError());
|
||||
ok(result != NULL, "GetAddrInfoW failed\n");
|
||||
pFreeAddrInfoW(result);
|
||||
|
||||
result = NULL;
|
||||
ret = pGetAddrInfoW(empty, zero, NULL, &result);
|
||||
ok(!ret, "GetAddrInfoW failed with %d\n", WSAGetLastError());
|
||||
ok(result != NULL, "GetAddrInfoW failed\n");
|
||||
pFreeAddrInfoW(result);
|
||||
|
||||
result = NULL;
|
||||
ret = pGetAddrInfoW(empty, empty, NULL, &result);
|
||||
ok(!ret, "GetAddrInfoW failed with %d\n", WSAGetLastError());
|
||||
ok(result != NULL, "GetAddrInfoW failed\n");
|
||||
pFreeAddrInfoW(result);
|
||||
|
||||
result = NULL;
|
||||
ret = pGetAddrInfoW(localhost, NULL, NULL, &result);
|
||||
ok(!ret, "GetAddrInfoW failed with %d\n", WSAGetLastError());
|
||||
|
@ -5528,12 +5540,24 @@ static void test_getaddrinfo(void)
|
|||
ok(result != NULL, "getaddrinfo failed\n");
|
||||
pfreeaddrinfo(result);
|
||||
|
||||
result = NULL;
|
||||
ret = pgetaddrinfo(NULL, "", NULL, &result);
|
||||
ok(!ret, "getaddrinfo failed with %d\n", WSAGetLastError());
|
||||
ok(result != NULL, "getaddrinfo failed\n");
|
||||
pfreeaddrinfo(result);
|
||||
|
||||
result = NULL;
|
||||
ret = pgetaddrinfo("", "0", NULL, &result);
|
||||
ok(!ret, "getaddrinfo failed with %d\n", WSAGetLastError());
|
||||
ok(result != NULL, "getaddrinfo failed\n");
|
||||
pfreeaddrinfo(result);
|
||||
|
||||
result = NULL;
|
||||
ret = pgetaddrinfo("", "", NULL, &result);
|
||||
ok(!ret, "getaddrinfo failed with %d\n", WSAGetLastError());
|
||||
ok(result != NULL, "getaddrinfo failed\n");
|
||||
pfreeaddrinfo(result);
|
||||
|
||||
result = NULL;
|
||||
ret = pgetaddrinfo("localhost", NULL, NULL, &result);
|
||||
ok(!ret, "getaddrinfo failed with %d\n", WSAGetLastError());
|
||||
|
|
Loading…
Reference in New Issue