]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
nits
authorHarlan Stenn <stenn@ntp.org>
Sun, 4 May 2014 04:51:37 +0000 (04:51 +0000)
committerHarlan Stenn <stenn@ntp.org>
Sun, 4 May 2014 04:51:37 +0000 (04:51 +0000)
bk: 5365c759BM8rAHkjRvLzc_nyPHBjBA

ntpd/ntp_leapsec.c
ntpd/ntp_util.c

index d85c75e439ffbbe3d61e804302e8e0b92de483e7..9fe24cf337b33c31b1a7df7d1ee344a97fb623b2 100644 (file)
@@ -456,7 +456,7 @@ leapsec_load_file(
        int          rc;
 
        /* just do nothing if there is no leap file */
-       if ( ! (fname && *fname))
+       if ( !(fname && *fname) )
                return FALSE;
        
        /* try to stat the leapfile */
@@ -468,9 +468,10 @@ leapsec_load_file(
 
        /* silently skip to postcheck if no new file found */
        if (NULL != sb_old) {
-               if (!force                              &&
-                   sb_old->st_mtime == sb_new.st_mtime &&
-                   sb_old->st_ctime == sb_new.st_ctime  )
+               if (!force
+                && sb_old->st_mtime == sb_new.st_mtime
+                && sb_old->st_ctime == sb_new.st_ctime
+                  )
                        return FALSE;
                *sb_old = sb_new;
        }
@@ -574,8 +575,8 @@ leapsec_add_dyn(
 
        pt = leapsec_get_table(TRUE);
        now64 = ntpcal_ntp_to_ntp(ntpnow, pivot);
-       return leapsec_add(pt, &now64, (insert != 0))
-           && leapsec_set_table(pt);
+       return (   leapsec_add(pt, &now64, (insert != 0))
+               && leapsec_set_table(pt));
 }
 
 /* =====================================================================
@@ -774,7 +775,7 @@ leapsec_add(
         * the extend the table beyond the expiration!
         */
        if (   ucmpv64(now64, &pt->head.expire) < 0
-          || (pt->head.size && ucmpv64(now64, &pt->info[0].ttime) <= 0)) {
+           || (pt->head.size && ucmpv64(now64, &pt->info[0].ttime) <= 0)) {
                errno = ERANGE;
                return FALSE;
        }
@@ -853,6 +854,7 @@ betweenu32(
        uint32_t hi)
 {
        int rc;
+
        if (lo <= hi)
                rc = (lo <= x) && (x < hi);
        else
index 76a2239d9814a95c6a279e255d44a97fd5ed1053..b522931dce5e6b1b0fa15d9e23ac2b85155b766b 100644 (file)
@@ -898,8 +898,8 @@ check_leap_file(
                                logPrefix, leapfile_name, -rc);
                else
                        msyslog(LOG_WARNING,
-                               "%s ('%s'): will expire in less than %d days",
-                               logPrefix, leapfile_name, 1+rc);
+                               "%s ('%s'): will expire in less than %d day%s",
+                               logPrefix, leapfile_name, 1+rc, (rc) ? "s" : "");
        }
 }