mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-24 21:34:08 +03:00
timedatectl: show "DST active: n/a" if no DST data is available
This commit is contained in:
parent
62ffb3327a
commit
e2fd5e5ba2
@ -102,7 +102,7 @@ int time_get_dst(time_t date, const char *tzfile,
|
||||
size_t tzspec_len;
|
||||
size_t num_leaps;
|
||||
size_t lo, hi;
|
||||
int err = 0;
|
||||
int err = -EINVAL;
|
||||
|
||||
f = fopen(tzfile, "re");
|
||||
if (f == NULL)
|
||||
|
@ -136,7 +136,9 @@ static void print_status_info(StatusInfo *i) {
|
||||
r = time_get_dst(sec, "/etc/localtime",
|
||||
&tc, &zc, &is_dstc,
|
||||
&tn, &zn, &is_dstn);
|
||||
if (r >= 0) {
|
||||
if (r < 0)
|
||||
printf(" DST active: n/a\n");
|
||||
else {
|
||||
printf(" DST active: %s\n", yes_no(is_dstc));
|
||||
|
||||
t = tc - 1;
|
||||
|
Loading…
Reference in New Issue
Block a user