]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add Windows version detection for Vista and 7
authorSebastian Hahn <sebastian@torproject.org>
Sun, 7 Feb 2010 04:18:50 +0000 (05:18 +0100)
committerSebastian Hahn <sebastian@torproject.org>
Wed, 10 Feb 2010 07:40:44 +0000 (08:40 +0100)
Vista is Windows 6.0, and 7 is Windows 6.1. Fixes bug 1097.

Also fix a coding style violation.

src/common/compat.c
src/or/config.c

index d45fda0be34a03a73e8d787f8190853ded2b59e5..7295bf25bd4a157caf5709ba62b7d0d57713719c 100644 (file)
@@ -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,
index 8421bfaa2d3bc9ac98ae2f903061fdbcf7e0f234..e544917ae4570d119c86139bdbe014d0c78cba02 100644 (file)
@@ -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) {