summaryrefslogtreecommitdiff
path: root/src/core/libs/lib-misc.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/libs/lib-misc.sh')
-rw-r--r--src/core/libs/lib-misc.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh
index e09f3c8..1e8df8e 100644
--- a/src/core/libs/lib-misc.sh
+++ b/src/core/libs/lib-misc.sh
@@ -103,18 +103,20 @@ cleanup_runtime ()
# $1 UTC or localtime (hardwareclock)
+# $2 direction (systohc or hctosys)
dohwclock() {
+ # TODO: we probably only need to do this once and then actually use adjtime on next invocations
infofy "Resetting hardware clock adjustment file"
[ ! -d /var/lib/hwclock ] && mkdir -p /var/lib/hwclock
if [ ! -f /var/lib/hwclock/adjtime ]; then
echo "0.0 0 0.0" > /var/lib/hwclock/adjtime
fi
- infofy "Syncing hardwareclock to systemclock ..."
+ infofy "Syncing clocks ($2), hc being $1 ..."
if [ "$1" = "UTC" ]; then
- hwclock --utc
+ hwclock --$2 --utc
else
- hwclock --localtime
+ hwclock --$2 --localtime
fi
}