Remove the gratuitous check for $FreeBSD$ and rename the function

to ntpd_init_leapfile, to ensure a copy exists in /var/db if a copy
isn't already there.

Reported by:	ache@
MFC after:	1 day
This commit is contained in:
Cy Schubert 2016-08-25 13:24:11 +00:00
parent ef63b26a5f
commit eb27c4c0e9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=304802

View File

@ -29,7 +29,7 @@ ntpd_precmd()
rc_flags="-g $rc_flags"
fi
ntpd_valid_leapfile
ntpd_init_leapfile
if [ ! -f $ntp_db_leapfile ]; then
ntpd_fetch_leapfile
@ -80,15 +80,12 @@ get_ntp_leapfile_expiry() {
'^\([1-9][0-9]*\)$' \| 0
}
ntpd_valid_leapfile() {
ntpd_init_leapfile() {
# Refresh working leapfile with an invalid hash due to
# FreeBSD id header. Ntpd will ignore leapfiles with a
# mismatch hash. The file must be the virgin file from
# the source.
if [ -f $ntp_db_leapfile ]; then
grep -q '\$FreeBSD.*\$' $ntp_db_leapfile &&
cp -p $ntp_src_leapfile $ntp_db_leapfile
else
if [ ! -f $ntp_db_leapfile ]; then
cp -p $ntp_src_leapfile $ntp_db_leapfile
fi
}