Skip to content

Commit

Permalink
init.d/swclock: use current time instead of default reference file
Browse files Browse the repository at this point in the history
A default reference file mtime may send the clock backwards of current deptree mtime.
Fixes OpenRC#675
  • Loading branch information
macmpi committed Dec 8, 2023
1 parent bfdafe4 commit c298f15
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion init.d/swclock.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ start()
{
ebegin "Setting the local clock based on last shutdown time"
if ! swclock "${swclock_file}" 2> /dev/null; then
swclock --warn @SBINDIR@/openrc-run
local curr_mtime="$(mktemp -q)"
swclock --warn "${curr_mtime}"
rm -f "${curr_mtime}"
fi
eend $?
}
Expand Down

0 comments on commit c298f15

Please sign in to comment.