mirror of
https://github.com/systemd/systemd.git
synced 2025-01-26 14:04:03 +03:00
time-util: fix shadowing of timezone
timezone was shadowing timezone from time.h which leads to a buildbreak since systemd is built with -Werror
This commit is contained in:
parent
983226f35a
commit
ff69484a1f
@ -883,16 +883,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);
|
||||
@ -910,7 +910,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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user