[systemd-devel] [PATCH 1/2] timedatectl: check for getenv("TZDIR")

Kay Sievers kay at vrfy.org
Tue Mar 24 11:32:25 PDT 2015


On Tue, Mar 24, 2015 at 7:11 PM, Shawn Landden <shawn at churchofgit.com> wrote:

>          /* Enforce the values of /etc/localtime */
>          if (getenv("TZ")) {
> -                fprintf(stderr, "Warning: Ignoring the TZ variable.\n\n");
> +                fprintf(stderr, "Warning: Ignoring the %s variable.\n\n", "TZ");

What style is that? A second static string inserted with %s?
Wanto de-duplicate the first static string? :)

> -                xstrftime(a, "%a %Y-%m-%d %H:%M:%S UTC", gmtime_r(&sec, &tm));
> +                xstrftime(a, "%a %Y-%m-%d %H:%M:%S UTC", gmtime);

Why this change?

> +                      "         RTC in UTC by calling 'timedatectl set-local-rtc 0'\n
> +                      "         For more details see http://www.cl.cam.ac.uk/~mgk25/mswish/ut-rtc.html" ANSI_HIGHLIGHT_OFF ".\n", stdout);

Hmm, I find links to "random" web pages in error output a bit too
unconventional.

Kay


More information about the systemd-devel mailing list