chiark / gitweb /
time-util: fix shadowing of timezone
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>
Tue, 19 Sep 2017 15:00:56 +0000 (17:00 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 19 Sep 2017 15:00:56 +0000 (17:00 +0200)
timezone was shadowing timezone from time.h which leads to a buildbreak
since elogind is built with -Werror

src/basic/time-util.c

index 9bcf5725ed47dd3b07790d0186a95f0fbb4d97cd..c19c3f60f52f1b907b3243612fa07f07194e9b87 100644 (file)
@@ -896,16 +896,16 @@ typedef struct ParseTimestampResult {
 } ParseTimestampResult;
 
 int parse_timestamp(const char *t, usec_t *usec) {
-        char *last_space, *timezone = NULL;
+        char *last_space, *tz = NULL;
         ParseTimestampResult *shared, tmp;
         int r;
         pid_t pid;
 
         last_space = strrchr(t, ' ');
         if (last_space != NULL && timezone_is_valid(last_space + 1))
-                timezone = last_space + 1;
+                tz = last_space + 1;
 
-        if (timezone == NULL || endswith_no_case(t, " UTC"))
+        if (tz == NULL || endswith_no_case(t, " UTC"))
                 return parse_timestamp_impl(t, usec, false);
 
         t = strndupa(t, last_space - t);
@@ -923,7 +923,7 @@ int parse_timestamp(const char *t, usec_t *usec) {
         }
 
         if (pid == 0) {
-                if (setenv("TZ", timezone, 1) != 0) {
+                if (setenv("TZ", tz, 1) != 0) {
                         shared->return_value = negative_errno();
                         _exit(EXIT_FAILURE);
                 }