From: JWP <elseifthen@gmx.com>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: [PATCH 2/4] hwclock: Incorrect UTC defaults
Date: Wed, 07 Jan 2015 23:15:39 -0500 [thread overview]
Message-ID: <54AE046B.7090706@gmx.com> (raw)
In-Reply-To: <54AE031C.30907@gmx.com>
Hwclock's default timescale was changed to UTC in:
commit 7894bf0f08740f75610990a2ba76af7a7cbce61e
Date: Mon Feb 21 13:27:07 2011 +0000
This change was incomplete.
With no /etc/adjtime file the current behavior is:
hwclock --utc --adjust #Creates a UTC file.
hwclock --localtime --adjust #File is not created.
That is the opposite of what UTC default should do.
With this patch the behavior is:
hwclock --utc --adjust #File is not created.
hwclock --localtime --adjust #Creates a LOCAL file.
'Creates a xxxx file' means: An /etc/adjtime file
is created with zero for all parameters except the
Hardware Clock's timescale field, which is set to
the value indicated by xxxx.
The second item missed in the patch was a test in
the save_adjtime() function that defaults to LOCAL.
Theoretically we cannot get to the save function
without having a value set for adjtime.local_utc,
but the test is there so it needs be correct.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
---
sys-utils/hwclock.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
index 008b20a..4d40dc5 100644
--- a/sys-utils/hwclock.c
+++ b/sys-utils/hwclock.c
@@ -272,7 +272,7 @@ static int read_adjtime(struct adjtime *adjtime_p)
adjtime_p->last_adj_time = 0;
adjtime_p->not_adjusted = 0;
adjtime_p->last_calib_time = 0;
- adjtime_p->local_utc = UNKNOWN;
+ adjtime_p->local_utc = UTC;
adjtime_p->dirty = FALSE; /* don't create a zero adjfile */
return 0;
@@ -1135,7 +1135,7 @@ static void save_adjtime(const struct adjtime adjtime, const bool testing)
(long)adjtime.last_adj_time,
adjtime.not_adjusted,
(long)adjtime.last_calib_time,
- (adjtime.local_utc == UTC) ? "UTC" : "LOCAL");
+ (adjtime.local_utc == LOCAL) ? "LOCAL" : "UTC");
if (testing) {
printf(_
next prev parent reply other threads:[~2015-01-08 4:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-08 4:10 [PATCH 0/4] hwclock: x86_64 -- UTC Defaults -- v2.26 man updates JWP
2015-01-08 4:13 ` [PATCH 1/4] hwclock: enable --directisa for x86_64 JWP
2015-01-09 9:51 ` Karel Zak
2015-01-08 4:15 ` JWP [this message]
2015-01-08 4:18 ` [PATCH 3/4] hwclock: update man page for v2.26 rc JWP
2015-01-10 12:44 ` Benno Schulenberg
2015-01-10 18:08 ` JWP
2015-01-11 11:44 ` Benno Schulenberg
2015-01-11 18:59 ` JWP
2015-01-12 9:37 ` Karel Zak
2015-01-08 4:22 ` [PATCH 4/4] hwclock: man page 'Since v2.26' notes JWP
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54AE046B.7090706@gmx.com \
--to=elseifthen@gmx.com \
--cc=kzak@redhat.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.