[Ada] Fix socket timeout correction for Windows Server 2019 case

Message ID 20200608080041.GA90247@adacore.com
State New
Headers show
Series
  • [Ada] Fix socket timeout correction for Windows Server 2019 case
Related show

Commit Message

Pierre-Marie de Rodat June 8, 2020, 8 a.m.
All Windows Servers till 2019 correcting the socket timeout for 500ms.

Tested on x86_64-pc-linux-gnu, committed on trunk

2020-06-08  Dmitriy Anisimkov  <anisimko@adacore.com>

gcc/ada/

	* socket.c (__gnat_minus_500ms): Remove
	IsWindowsVersionOrGreater from condition.

Patch

--- gcc/ada/socket.c
+++ gcc/ada/socket.c
@@ -801,10 +801,12 @@  const char * __gnat_gai_strerror(int errcode) {
 
 int __gnat_minus_500ms() {
 #if defined (_WIN32)
-  // Windows Server 2019 and Windows 8.0 do not need 500 millisecond socket
-  // timeout correction.
-  return !(IsWindows8OrGreater() && !IsWindowsServer()
-           || IsWindowsVersionOrGreater(10, 0, 17763));
+  // Windows 8.0 and newer do not need 500 millisecond socket timeout
+  // correction.
+  // We do not know the Windows server version without socket timeout
+  // correction for now. When we know, we can add the call for
+  // IsWindowsVersionOrGreater(10, 0, ????) into condition.
+  return !IsWindows8OrGreater() || IsWindowsServer();
 #else
    return 0;
 #endif