Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2012-07-24 17:56:14 +0400
committerCorinna Vinschen <corinna@vinschen.de>2012-07-24 17:56:14 +0400
commit67d71dbf1077f9f0acb1b569e99ae88817e81580 (patch)
treeea625bbf49374888bc3142969b19d74263ae6714 /winsup/cygwin/wincap.cc
parent5f3eab86a62f02f6df70c4948a7382ae0480a1ec (diff)
* wincap.cc (wincapc::init): Drop memset call since it can result in
a race condition. Drop all considerations for pre-Windows 2000 systems since Cygwin won't start on them anyway.
Diffstat (limited to 'winsup/cygwin/wincap.cc')
-rw-r--r--winsup/cygwin/wincap.cc86
1 files changed, 33 insertions, 53 deletions
diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc
index c5cac6aa2..48b51c275 100644
--- a/winsup/cygwin/wincap.cc
+++ b/winsup/cygwin/wincap.cc
@@ -347,71 +347,51 @@ wincapc::init ()
return; // already initialized
GetSystemInfo (&system_info);
- memset (&version, 0, sizeof version);
version.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX);
- if (!GetVersionEx (reinterpret_cast<LPOSVERSIONINFO>(&version)))
- api_fatal ("Cygwin requires at least Windows 2000.");
+ GetVersionEx (reinterpret_cast<LPOSVERSIONINFO>(&version));
- switch (version.dwPlatformId)
+ switch (version.dwMajorVersion)
{
- case VER_PLATFORM_WIN32_NT:
- switch (version.dwMajorVersion)
+ case 5:
+ switch (version.dwMinorVersion)
{
- case 4:
- /* I'd be very surprised if this code is ever hit, but it doesn't
- hurt to keep it. */
- api_fatal ("Cygwin requires at least Windows 2000.");
+ case 0:
+ if (version.wServicePackMajor < 4)
+ caps = &wincap_2000;
+ else
+ caps = &wincap_2000sp4;
break;
- case 5:
- switch (version.dwMinorVersion)
- {
- case 0:
- if (version.wServicePackMajor < 4)
- caps = &wincap_2000;
- else
- caps = &wincap_2000sp4;
- break;
-
- case 1:
- caps = &wincap_xp;
- switch (version.wServicePackMajor)
- {
- case 0:
- caps = &wincap_xp;
- case 1:
- caps = &wincap_xpsp1;
- default:
- caps = &wincap_xpsp2;
- }
- break;
- default:
- caps = &wincap_2003;
- }
- break;
- case 6:
- switch (version.dwMinorVersion)
+ case 1:
+ caps = &wincap_xp;
+ switch (version.wServicePackMajor)
{
- case 0:
- caps = &wincap_vista;
- break;
- case 1:
- caps = &wincap_7;
- break;
- default:
- caps = &wincap_8;
- break;
+ case 0:
+ caps = &wincap_xp;
+ case 1:
+ caps = &wincap_xpsp1;
+ default:
+ caps = &wincap_xpsp2;
}
break;
+
default:
- caps = &wincap_minimal;
- break;
+ caps = &wincap_2003;
}
break;
- case VER_PLATFORM_WIN32_WINDOWS:
- /* I'd be very surprised if this code is ever hit, but it doesn't
- hurt to keep it. */
- api_fatal ("Windows 95/98/Me are not supported.");
+ case 6:
+ switch (version.dwMinorVersion)
+ {
+ case 0:
+ caps = &wincap_vista;
+ break;
+ case 1:
+ caps = &wincap_7;
+ break;
+ default:
+ caps = &wincap_8;
+ break;
+ }
break;
default:
caps = &wincap_minimal;