]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
time-util: drop unnecessary assignment of timezone name
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 15 Feb 2023 04:51:15 +0000 (13:51 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 23 Feb 2023 23:55:27 +0000 (08:55 +0900)
As mktime() does not use timezone neme.

src/basic/time-util.c

index ea381da8f97630f776d7751589ab4275fe17f15f..1206ecd1b20873ff76ffff683695814ad78d3d2c 100644 (file)
@@ -631,7 +631,7 @@ static int parse_timestamp_impl(const char *t, usec_t *ret, bool with_tz) {
                 { "Sat",       6 },
         };
 
-        const char *k, *utc = NULL, *tzn = NULL;
+        const char *k, *utc = NULL;
         struct tm tm, copy;
         usec_t usec, plus = 0, minus = 0;
         int r, weekday = -1, isdst = -1;
@@ -746,7 +746,6 @@ static int parse_timestamp_impl(const char *t, usec_t *ret, bool with_tz) {
                                 /* Found one of the two timezones specified. */
                                 t = strndupa_safe(t, e - t - 1);
                                 isdst = j;
-                                tzn = tzname[j];
                         }
                 }
         }
@@ -757,8 +756,6 @@ static int parse_timestamp_impl(const char *t, usec_t *ret, bool with_tz) {
                 return -EINVAL;
 
         tm.tm_isdst = isdst;
-        if (!with_tz && tzn)
-                tm.tm_zone = tzn;
 
         if (streq(t, "today")) {
                 tm.tm_sec = tm.tm_min = tm.tm_hour = 0;