diff options
-rw-r--r-- | src/shared/time-dst.c | 2 | ||||
-rw-r--r-- | src/timedate/timedatectl.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/shared/time-dst.c b/src/shared/time-dst.c index 8f3cafd5eb..df5f15151d 100644 --- a/src/shared/time-dst.c +++ b/src/shared/time-dst.c @@ -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) diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c index b7f2422a16..564f9e5f74 100644 --- a/src/timedate/timedatectl.c +++ b/src/timedate/timedatectl.c @@ -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; |