From owner-svn-src-all@freebsd.org Thu Aug 25 13:24:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C987BC5151; Thu, 25 Aug 2016 13:24:12 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FC3511A5; Thu, 25 Aug 2016 13:24:12 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PDOBCc083222; Thu, 25 Aug 2016 13:24:11 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PDOBfO083221; Thu, 25 Aug 2016 13:24:11 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201608251324.u7PDOBfO083221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 25 Aug 2016 13:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304802 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 13:24:12 -0000 Author: cy Date: Thu Aug 25 13:24:11 2016 New Revision: 304802 URL: https://svnweb.freebsd.org/changeset/base/304802 Log: 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 Modified: head/etc/rc.d/ntpd Modified: head/etc/rc.d/ntpd ============================================================================== --- head/etc/rc.d/ntpd Thu Aug 25 12:42:41 2016 (r304801) +++ head/etc/rc.d/ntpd Thu Aug 25 13:24:11 2016 (r304802) @@ -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 }