]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 233] Apply rest of patch from Matthias Drochner
authorHarlan Stenn <stenn@ntp.org>
Tue, 20 Jul 2004 06:26:12 +0000 (02:26 -0400)
committerHarlan Stenn <stenn@ntp.org>
Tue, 20 Jul 2004 06:26:12 +0000 (02:26 -0400)
bk: 40fcbb04s_XdLW-JEmpNRfY9uYPHiQ

ntpd/refclock_shm.c
ntpdc/ntpdc_ops.c

index 4ab0eded8644aeace06bfe44f4a31d835a3a965c..8491c28de1db77341f3628fca23087be6c9c650a 100644 (file)
@@ -266,11 +266,14 @@ shm_poll(
                }
                up->valid=0;
                if (ok) {
+                       time_t help;    /* XXX NetBSD has incompatible tv_sec */
+
                        TVTOTS(&tvr,&pp->lastrec);
                        pp->lastrec.l_ui += JAN_1970;
                        /* pp->lasttime = current_time; */
                        pp->polls++;
-                       t=gmtime (&tvt.tv_sec);
+                       help = tvt.tv_sec;
+                       t = gmtime (&help);
                        pp->day=t->tm_yday+1;
                        pp->hour=t->tm_hour;
                        pp->minute=t->tm_min;
index 6f6f20806114c8761bc1e7c36166d3fc3500bd03..6ec4ba555247ae664cac6f4e514b3f8f5af8661b 100644 (file)
@@ -862,11 +862,11 @@ again:
                NTOHL_FP(&il->drift_comp, &temp2ts);
 
                (void) fprintf(fp,
-                              "offset %s, frequency %s, time_const %ld, watchdog %ld\n",
+                              "offset %s, frequency %s, time_const %d, watchdog %ld\n",
                               lfptoa(&tempts, 6),
                               lfptoa(&temp2ts, 3),
                               (u_long)ntohl(il->compliance),
-                              (u_long)ntohl(il->watchdog_timer));
+                              (int)ntohl(il->watchdog_timer));
        } else {
                NTOHL_FP(&il->last_offset, &tempts);
                (void) fprintf(fp, "offset:               %s s\n",
@@ -874,8 +874,8 @@ again:
                NTOHL_FP(&il->drift_comp, &tempts);
                (void) fprintf(fp, "frequency:            %s ppm\n",
                               lfptoa(&tempts, 3));
-               (void) fprintf(fp, "poll adjust:          %ld\n",
-                              (u_long)ntohl(il->compliance));
+               (void) fprintf(fp, "poll adjust:          %d\n",
+                              (int)ntohl(il->compliance));
                (void) fprintf(fp, "watchdog timer:       %ld s\n",
                               (u_long)ntohl(il->watchdog_timer));
        }
@@ -2919,7 +2919,7 @@ again:
                tscale = 1e-9;
 #endif
        (void)fprintf(fp, "pll offset:           %g s\n",
-           (long)ntohl(ik->offset) * tscale);
+           (int)ntohl(ik->offset) * tscale);
        (void)fprintf(fp, "pll frequency:        %s ppm\n",
            fptoa((s_fp)ntohl(ik->freq), 3));
        (void)fprintf(fp, "maximum error:        %g s\n",