]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
In comments and logs, say "UTC" not "GMT"
authorNick Mathewson <nickm@torproject.org>
Fri, 23 Nov 2012 15:05:16 +0000 (10:05 -0500)
committerNick Mathewson <nickm@torproject.org>
Fri, 23 Nov 2012 15:05:16 +0000 (10:05 -0500)
Fix for #6113.

Note that the RFC1123 times we generate still all say 'GMT'.  I'm
going to suggest this is not worth changing.

changes/bug6113 [new file with mode: 0644]
src/common/tortls.c
src/common/util.c
src/or/confparse.h
src/or/hibernate.c
src/or/networkstatus.c
src/or/statefile.c

diff --git a/changes/bug6113 b/changes/bug6113
new file mode 100644 (file)
index 0000000..436243d
--- /dev/null
@@ -0,0 +1,3 @@
+  o Trivial bugfixes:
+    - Fix log messages and comments to avoid saying "GMT" when we mean
+      "UTC". Fixes bug 6113.
index 76924b31778c607c7257ee83844c0f379b3abf2f..af3059a02daac938cf6a867916361bb2a3146d2f 100644 (file)
@@ -2077,7 +2077,7 @@ log_cert_lifetime(int severity, const X509 *cert, const char *problem)
   BIO_get_mem_ptr(bio, &buf);
   s2 = tor_strndup(buf->data, buf->length);
 
-  strftime(mytime, 32, "%b %d %H:%M:%S %Y GMT", tor_gmtime_r(&now, &tm));
+  strftime(mytime, 32, "%b %d %H:%M:%S %Y UTC", tor_gmtime_r(&now, &tm));
 
   log(severity, LD_GENERAL,
       "(certificate lifetime runs from %s through %s. Your time is %s.)",
index 1b0603a469fafadaf50cdef5eac77e7bed61250c..44cdd64d6b9d8cf9bc30073e18ca00ef2a5b04d0 100644 (file)
@@ -1342,7 +1342,7 @@ n_leapdays(int y1, int y2)
 static const int days_per_month[] =
   { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
 
-/** Compute a time_t given a struct tm.  The result is given in GMT, and
+/** Compute a time_t given a struct tm.  The result is given in UTC, and
  * does not account for leap seconds.  Return 0 on success, -1 on failure.
  */
 int
@@ -1383,10 +1383,11 @@ static const char *MONTH_NAMES[] =
   { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
     "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
 
-/** Set <b>buf</b> to the RFC1123 encoding of the GMT value of <b>t</b>.
+/** Set <b>buf</b> to the RFC1123 encoding of the UTC value of <b>t</b>.
  * The buffer must be at least RFC1123_TIME_LEN+1 bytes long.
  *
- * (RFC1123 format is Fri, 29 Sep 2006 15:54:20 GMT)
+ * (RFC1123 format is "Fri, 29 Sep 2006 15:54:20 GMT". Note the "GMT"
+ * rather than "UTC".)
  */
 void
 format_rfc1123_time(char *buf, time_t t)
@@ -1404,8 +1405,8 @@ format_rfc1123_time(char *buf, time_t t)
   memcpy(buf+8, MONTH_NAMES[tm.tm_mon], 3);
 }
 
-/** Parse the RFC1123 encoding of some time (in GMT) from <b>buf</b>,
- * and store the result in *<b>t</b>.
+/** Parse the (a subset of) the RFC1123 encoding of some time (in UTC) from
+ * <b>buf</b>, and store the result in *<b>t</b>.
  *
  * Return 0 on success, -1 on failure.
 */
index f33208eb547490db785b095de6bd09d91d2e64d8..20616be925d8c1d2f4f14b2fb505797513148240 100644 (file)
@@ -23,7 +23,7 @@ typedef enum config_type_t {
   CONFIG_TYPE_BOOL,         /**< A boolean value, expressed as 0 or 1. */
   CONFIG_TYPE_AUTOBOOL,     /**< A boolean+auto value, expressed 0 for false,
                              * 1 for true, and -1 for auto  */
-  CONFIG_TYPE_ISOTIME,      /**< An ISO-formatted time relative to GMT. */
+  CONFIG_TYPE_ISOTIME,      /**< An ISO-formatted time relative to UTC. */
   CONFIG_TYPE_CSV,          /**< A list of strings, separated by commas and
                               * optional whitespace. */
   CONFIG_TYPE_LINELIST,     /**< Uninterpreted config lines */
index 9e54eb4b4c1f7ebe5b9371400f7a15c5e73e06bf..72089962ae87e0175c454c57ddd2329218929044 100644 (file)
@@ -890,12 +890,12 @@ hibernate_end_time_elapsed(time_t now)
       /* We weren't sleeping before; we should sleep now. */
       log_notice(LD_ACCT,
                  "Accounting period ended. Commencing hibernation until "
-                 "%s GMT", buf);
+                 "%s UTC", buf);
       hibernate_go_dormant(now);
     } else {
       log_notice(LD_ACCT,
              "Accounting period ended. This period, we will hibernate"
-             " until %s GMT",buf);
+             " until %s UTC",buf);
     }
   }
 }
index f33de4c1884ecec0ad77d5a537f39af05ff4cb2d..63426e8e4d93e9c749fd66c3b6d4c5f04fd02366 100644 (file)
@@ -775,7 +775,7 @@ router_set_networkstatus_v2(const char *s, time_t arrived_at,
     long delta = now - ns->published_on;
     format_time_interval(dbuf, sizeof(dbuf), delta);
     log_warn(LD_GENERAL, "Network status from %s was published %s in the "
-             "future (%s GMT). Check your time and date settings! "
+             "future (%s UTC). Check your time and date settings! "
              "Not caching.",
              source_desc, dbuf, published);
     control_event_general_status(LOG_WARN,
@@ -1874,7 +1874,7 @@ networkstatus_set_current_consensus(const char *consensus,
     format_iso_time(tbuf, c->valid_after);
     format_time_interval(dbuf, sizeof(dbuf), delta);
     log_warn(LD_GENERAL, "Our clock is %s behind the time published in the "
-             "consensus network status document (%s GMT).  Tor needs an "
+             "consensus network status document (%s UTC).  Tor needs an "
              "accurate clock to work correctly. Please check your time and "
              "date settings!", dbuf, tbuf);
     control_event_general_status(LOG_WARN,
index beb9cf81ba643858395a4538d61841e2a26d81b9..55ba0c1602bfd7a73005c969af4ac7aa04035752 100644 (file)
@@ -416,7 +416,7 @@ or_state_save(time_t now)
   format_local_iso_time(tbuf, now);
   tor_asprintf(&contents,
                "# Tor state file last generated on %s local time\n"
-               "# Other times below are in GMT\n"
+               "# Other times below are in UTC\n"
                "# You *do not* need to edit this file.\n\n%s",
                tbuf, state);
   tor_free(state);