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 | |
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.
-rw-r--r-- | src/common/compat.c | 5 | ||||
-rw-r--r-- | src/or/config.c | 2 |
2 files changed, 4 insertions, 3 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, diff --git a/src/or/config.c b/src/or/config.c index 8421bfaa2d..e544917ae4 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -2223,7 +2223,7 @@ resolve_my_address(int warn_severity, or_options_t *options, if (tor_inet_aton(hostname, &in) == 0) { /* then we have to resolve it */ explicit_ip = 0; - if(!tor_lookup_hostname(hostname, &addr)) { + if (!tor_lookup_hostname(hostname, &addr)) { uint32_t interface_ip; if (explicit_hostname) { |