Bug 1385597 - Properly restore system timezone on other POSIX systems. r?ehsan draft
authorJan Beich <jbeich@FreeBSD.org>
Sat, 29 Jul 2017 16:16:02 +0000
changeset 618042 34ff0f6eff34bbc1097ff6f399944c5910519f7a
parent 617496 16ffc1d05422a81099ce8b9b59de66dde4c8b2f0
child 639951 efa1d7a58f4e7a53fc5162f3639bb91e496cdd19
push id71204
push userbmo:jbeich@FreeBSD.org
push dateSat, 29 Jul 2017 17:57:22 +0000
reviewersehsan
bugs1385597
milestone56.0a1
Bug 1385597 - Properly restore system timezone on other POSIX systems. r?ehsan MozReview-Commit-ID: 4viT99nrph4
toolkit/components/resistfingerprinting/nsRFPService.cpp
--- a/toolkit/components/resistfingerprinting/nsRFPService.cpp
+++ b/toolkit/components/resistfingerprinting/nsRFPService.cpp
@@ -157,24 +157,24 @@ nsRFPService::UpdatePref()
       }
       // PR_SetEnv() needs the input string been leaked intentionally, so
       // we copy it here.
       tz = ToNewCString(tzValue);
       if (tz) {
         PR_SetEnv(tz);
       }
     } else {
-#if defined(XP_LINUX) || defined (XP_MACOSX)
+#if defined(XP_WIN)
+      // For Windows, we reset the TZ to an empty string. This will make Windows to use
+      // its system timezone.
+      PR_SetEnv("TZ=");
+#else
       // For POSIX like system, we reset the TZ to the /etc/localtime, which is the
       // system timezone.
       PR_SetEnv("TZ=:/etc/localtime");
-#else
-      // For Windows, we reset the TZ to an empty string. This will make Windows to use
-      // its system timezone.
-      PR_SetEnv("TZ=");
 #endif
     }
   }
 
   nsJSUtils::ResetTimeZone();
 }
 
 void