diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2010-02-07 05:18:50 +0100 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2010-02-10 08:40:44 +0100 |
commit | fe1827556339130da9ade0b9e8e85952493a0aeb (patch) | |
tree | 2e8d7a04ca856bca3de977a54bb258a174f870e5 /src/common | |
parent | a4ef33a3f887f026827e7d47e29281d8f587dfc9 (diff) | |
download | tor-fe1827556339130da9ade0b9e8e85952493a0aeb.tar.gz tor-fe1827556339130da9ade0b9e8e85952493a0aeb.zip |
Add Windows version detection for Vista and 7
Vista is Windows 6.0, and 7 is Windows 6.1. Fixes bug 1097.
Also fix a coding style violation.
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/compat.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/compat.c b/src/common/compat.c index d45fda0be3..7295bf25bd 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -1613,7 +1613,8 @@ get_uname(void) static struct { unsigned major; unsigned minor; const char *version; } win_version_table[] = { - { 6, 0, "Windows \"Longhorn\"" }, + { 6, 1, "Windows 7" }, + { 6, 0, "Windows Vista" }, { 5, 2, "Windows Server 2003" }, { 5, 1, "Windows XP" }, { 5, 0, "Windows 2000" }, @@ -1663,7 +1664,7 @@ get_uname(void) plat, extra); } else { if (info.dwMajorVersion > 6 || - (info.dwMajorVersion==6 && info.dwMinorVersion>0)) + (info.dwMajorVersion==6 && info.dwMinorVersion>1)) tor_snprintf(uname_result, sizeof(uname_result), "Very recent version of Windows [major=%d,minor=%d] %s", (int)info.dwMajorVersion,(int)info.dwMinorVersion, |