Re: pull: hwclock 27 changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 01/08/2017 04:39 AM, Sami Kerola wrote:
> On 7 January 2017 at 23:06, Sami Kerola <kerolasa@xxxxxx> 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@xxxxxxx>'. 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< ---- 

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux