[systemd-devel] [PATCH 1/2] timedatectl: check for getenv("TZDIR")
Shawn Landden
shawn at churchofgit.com
Tue Mar 24 11:39:03 PDT 2015
On Tue, Mar 24, 2015 at 11:32 AM, Kay Sievers <kay at vrfy.org> wrote:
> 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? :)
yep
>
>> - 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?
localtime_r() and gmtime_r() are called multiple times.
>
>> + " 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.
OK, but the page has been around for years and does tell Windows users
what registry entry to set to use UTC for their RTC.
>
> Kay
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
Shawn Landden
More information about the systemd-devel
mailing list