From: J William Piggott <elseifthen@gmx.com>
To: kerolasa@gmail.com
Cc: util-linux <util-linux@vger.kernel.org>
Subject: Re: pull: hwclock 27 changes
Date: Sun, 8 Jan 2017 16:21:49 -0500 [thread overview]
Message-ID: <eaaddf6f-dd4b-cd91-cfec-07d45bb07542@gmx.com> (raw)
In-Reply-To: <CAG27Bk2Kg4MQFKSDwAxM849HJ7AxZWLX1vGL21qO042za=V1pw@mail.gmail.com>
On 01/08/2017 04:39 AM, Sami Kerola wrote:
> On 7 January 2017 at 23:06, Sami Kerola <kerolasa@iki.fi> wrote:
>> On Sat, 7 Jan 2017, J William Piggott wrote:
>> git://github.com/kerolasa/lelux-utiliteetit.git hwclock-jwp-reviewed
>>
>> that has in almost all changes 'Reviewed-by: J William Piggott
>> <elseifthen@gmx.com>'. Notice also that the latest update is not 100%
>> ready. We have question of --compare open, and 'hwclock: move command-line
>> options to control structure' has issue that is not yet corrected yet.
>
> hwclock-jwp-reviewed got update:
>
> -- snip
> diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
> index b41acd450..c3bcc2fa0 100644
> --- a/sys-utils/hwclock.c
> +++ b/sys-utils/hwclock.c
> @@ -1245,11 +1245,6 @@ manipulate_clock(const struct hwclock_control
> *ctl, const time_t set_time,
> adjtime->dirty = TRUE;
> }
>
> - if (ctl->noadjfile || (ctl->systz && (ctl->utc || ctl->local_opt))) {
> - /* A little trick to avoid writing the file if we don't have to */
> - adjtime->dirty = FALSE;
> - }
> -
> if (ctl->show || ctl->get || ctl->adjust || ctl->hctosys
> || (!ctl->noadjfile && !ctl->systz && !ctl->predict)) {
> /* data from HW-clock are required */
> @@ -1558,7 +1553,7 @@ int main(int argc, char **argv)
> {
> struct hwclock_control ctl = { 0 };
> struct timeval startup_time;
> - struct adjtime adjtime;
> + struct adjtime adjtime = { 0 };
> /*
> * The time we started up, in seconds into the epoch, including
> * fractions.
> @@ -1839,8 +1834,12 @@ int main(int argc, char **argv)
> }
> }
>
> - if ((rc = read_adjtime(&ctl, &adjtime)) != 0)
> - hwclock_exit(&ctl, rc);
> + if (!ctl.noadjfile && !(ctl.systz && (ctl.utc || ctl.local_opt))) {
> + if ((rc = read_adjtime(&ctl, &adjtime)) != 0)
> + hwclock_exit(&ctl, rc);
> + } else
> + /* avoid writing adjtime file if we don't have to */
> + adjtime.dirty = FALSE;
> ctl.universal = hw_clock_is_utc(&ctl, adjtime);
> if (ctl.compare) {
> if (compare_clock(&ctl))
> -- snip
>
> that should fix:
Yes, this looks good I think.
The contents of the added if/else statements don't look indented though.
I like your improved comment, you might want to capitalize it and use
a period.
8< ----
next prev parent reply other threads:[~2017-01-08 21:28 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-31 21:41 pull: hwclock 27 changes Sami Kerola
2017-01-03 14:34 ` J William Piggott
[not found] ` <05e4405f-8096-9261-f9f2-d2c6b84675bc@gmx.com>
2017-01-07 19:37 ` J William Piggott
2017-01-07 20:32 ` J William Piggott
2017-01-07 23:06 ` Sami Kerola
2017-01-08 9:39 ` Sami Kerola
2017-01-08 21:21 ` J William Piggott [this message]
2017-01-08 10:09 ` Sami Kerola
2017-01-08 21:21 ` J William Piggott
2017-01-08 21:21 ` J William Piggott
2017-01-11 21:44 ` Sami Kerola
2017-01-13 1:30 ` J William Piggott
2017-01-14 9:34 ` Sami Kerola
2017-01-14 22:51 ` J William Piggott
2017-01-22 19:03 ` J William Piggott
2017-01-25 21:54 ` Sami Kerola
2017-01-27 2:07 ` J William Piggott
2017-02-02 15:04 ` [ping] Karel: " J William Piggott
2017-02-03 22:41 ` Sami Kerola
2017-02-11 17:10 ` J William Piggott
2017-02-04 18:47 ` Karel Zak
2017-02-05 22:37 ` Sami Kerola
2017-02-09 10:43 ` Karel Zak
2017-02-09 11:09 ` Karel Zak
2017-02-11 17:10 ` J William Piggott
2017-01-09 11:32 ` Karel Zak
2017-01-09 13:53 ` J William Piggott
2017-01-09 20:48 ` Bjarni Ingi Gislason
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=eaaddf6f-dd4b-cd91-cfec-07d45bb07542@gmx.com \
--to=elseifthen@gmx.com \
--cc=kerolasa@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox