[systemd-commits] src/shared src/timedate

Kay Sievers kay at kemper.freedesktop.org
Fri Nov 2 08:45:50 PDT 2012


 src/shared/time-dst.c      |    2 +-
 src/timedate/timedatectl.c |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit e2fd5e5ba281a22886fa3797dc6265cca670448b
Author: Kay Sievers <kay at vrfy.org>
Date:   Fri Nov 2 05:45:02 2012 -1000

    timedatectl: show "DST active: n/a" if no DST data is available

diff --git a/src/shared/time-dst.c b/src/shared/time-dst.c
index 8f3cafd..df5f151 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 b7f2422..564f9e5 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;



More information about the systemd-commits mailing list