From: Karel Zak Date: Thu, 4 Mar 2021 10:27:47 +0000 (+0100) Subject: hwclock: use pointer to adjtime data X-Git-Tag: v2.37-rc1~84 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=81329c8d1c4f6b22bcd521a70e3754d810ff9eac;p=thirdparty%2Futil-linux.git hwclock: use pointer to adjtime data Signed-off-by: Karel Zak --- diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c index db448687dc..81ac64695c 100644 --- a/sys-utils/hwclock.c +++ b/sys-utils/hwclock.c @@ -196,7 +196,7 @@ static struct timeval time_inc(struct timeval addend, double increment) static int hw_clock_is_utc(const struct hwclock_control *ctl, - const struct adjtime adjtime) + const struct adjtime *adjtime) { int ret; @@ -206,7 +206,8 @@ hw_clock_is_utc(const struct hwclock_control *ctl, ret = 0; /* --localtime explicitly given */ else /* get info from adjtime file - default is UTC */ - ret = (adjtime.local_utc != LOCAL); + ret = (adjtime->local_utc != LOCAL); + if (ctl->verbose) printf(_("Assuming hardware clock is kept in %s time.\n"), ret ? _("UTC") : _("local")); @@ -1474,7 +1475,8 @@ int main(int argc, char **argv) } else /* Avoid writing adjtime file if we don't have to. */ adjtime.dirty = 0; - ctl.universal = hw_clock_is_utc(&ctl, adjtime); + + ctl.universal = hw_clock_is_utc(&ctl, &adjtime); rc = manipulate_clock(&ctl, set_time, startup_time, &adjtime); if (ctl.testing) puts(_("Test mode: nothing was changed."));