fix expression bug on socket creation failure (fd<0 is always false because fd is unsigned and Windows returns ~0 (-1) on socket failure)

pull/1370/head
zeliard 10 years ago
commit 04ddd8c524
  1. 2
      test/core/util/port_windows.c
  2. 4
      vsprojects/grpc_test_util/grpc_test_util.vcxproj

@ -57,7 +57,7 @@ static int is_port_available(int *port, int is_tcp) {
GPR_ASSERT(*port >= 0); GPR_ASSERT(*port >= 0);
GPR_ASSERT(*port <= 65535); GPR_ASSERT(*port <= 65535);
if (fd < 0) { if (INVALID_SOCKET == fd) {
gpr_log(GPR_ERROR, "socket() failed: %s", strerror(errno)); gpr_log(GPR_ERROR, "socket() failed: %s", strerror(errno));
return 0; return 0;
} }

@ -146,14 +146,14 @@
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\test\core\end2end\cq_verifier.c">
</ClCompile>
<ClCompile Include="..\..\test\core\end2end\data\server1_cert.c"> <ClCompile Include="..\..\test\core\end2end\data\server1_cert.c">
</ClCompile> </ClCompile>
<ClCompile Include="..\..\test\core\end2end\data\server1_key.c"> <ClCompile Include="..\..\test\core\end2end\data\server1_key.c">
</ClCompile> </ClCompile>
<ClCompile Include="..\..\test\core\end2end\data\test_root_cert.c"> <ClCompile Include="..\..\test\core\end2end\data\test_root_cert.c">
</ClCompile> </ClCompile>
<ClCompile Include="..\..\test\core\end2end\cq_verifier.c">
</ClCompile>
<ClCompile Include="..\..\test\core\iomgr\endpoint_tests.c"> <ClCompile Include="..\..\test\core\iomgr\endpoint_tests.c">
</ClCompile> </ClCompile>
<ClCompile Include="..\..\test\core\statistics\census_log_tests.c"> <ClCompile Include="..\..\test\core\statistics\census_log_tests.c">

Loading…
Cancel
Save