public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin/main] Cygwin: cygcheck: improve OS output
Date: Thu,  9 Feb 2023 13:41:27 +0000 (GMT)	[thread overview]
Message-ID: <20230209134127.2AE0B3858C50@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=dc70c8dec19b74f0b8668704a2492b4b04d56b73

commit dc70c8dec19b74f0b8668704a2492b4b04d56b73
Author:     Corinna Vinschen <corinna@vinschen.de>
AuthorDate: Thu Feb 9 14:41:12 2023 +0100
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Thu Feb 9 14:41:12 2023 +0100

    Cygwin: cygcheck: improve OS output
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/utils/mingw/cygcheck.cc | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/winsup/utils/mingw/cygcheck.cc b/winsup/utils/mingw/cygcheck.cc
index bdab6e2718ed..66af2ce0b6a2 100644
--- a/winsup/utils/mingw/cygcheck.cc
+++ b/winsup/utils/mingw/cygcheck.cc
@@ -31,6 +31,10 @@
 #include <mntent.h>
 #include "loadlib.h"
 
+#ifndef PRODUCT_IOTENTERPRISES
+#define PRODUCT_IOTENTERPRISES 0x000000bf
+#endif
+
 #ifndef max
 #define max __max
 #endif
@@ -1423,24 +1427,24 @@ dump_sysinfo ()
 	      {
 	      case 0:
 		strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION
-				? "Vista" : "2008");
+				? "Vista" : "Server 2008");
 		break;
 	      case 1:
 		strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION
-				? "7" : "2008 R2");
+				? "7" : "Server 2008 R2");
 		break;
 	      case 2:
 		strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION
-				? "8" : "2012");
+				? "8" : "Server 2012");
 		break;
 	      case 3:
 		strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION
-				? "8.1" : "2012 R2");
+				? "8.1" : "Server 2012 R2");
 		break;
 	      case 4:
 	      default:
 		strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION
-				? "10 Preview" : "2016 Preview");
+				? "10 Preview" : "Server 2016 Preview");
 		break;
 	      }
 	  else if (osversion.dwMajorVersion == 10)
@@ -1450,13 +1454,13 @@ dump_sysinfo ()
 	      else
 		{
 		  if (osversion.dwBuildNumber <= 14393)
-		    strcpy (osname, "2016");
+		    strcpy (osname, "Server 2016");
 		  else if (osversion.dwBuildNumber <= 17763)
-		    strcpy (osname, "2019");
+		    strcpy (osname, "Server 2019");
 		  else if (osversion.dwBuildNumber <= 20348)
-		    strcpy (osname, "2022");
+		    strcpy (osname, "Server 2022");
 		  else
-		    strcpy (osname, "20??");
+		    strcpy (osname, "Server 20??");
 		}
 	    }
 	  DWORD prod;
@@ -1663,7 +1667,7 @@ dump_sysinfo ()
 		};
 	      if (prod == PRODUCT_UNLICENSED)
 		strcat (osname, "Unlicensed");
-	      else if (prod > 0x000000bf)
+	      else if (prod > PRODUCT_IOTENTERPRISES)
 		strcat (osname, "");
 	      else
 		strcat (osname, products[prod]);

                 reply	other threads:[~2023-02-09 13:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230209134127.2AE0B3858C50@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).