Bug 1385597 - Properly restore system timezone on other POSIX systems. r=Ehsan
authorJan Beich <jbeich@FreeBSD.org>
Sat, 29 Jul 2017 16:16:02 +0000
changeset 420827 a470ec390d7b24a1685c0081cc4ac5f455e86c02
parent 420826 310c1b6a7127da2a53f9bec0e9717a039281ab8c
child 420828 1cf8b34f618eab61e33d1d4331db057522462ae3
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEhsan
bugs1385597
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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