From: Harlan Stenn Date: Tue, 20 Jul 2004 06:26:12 +0000 (-0400) Subject: [Bug 233] Apply rest of patch from Matthias Drochner X-Git-Tag: NTP_4_2_3~158 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f2685541e30c5e1bb87bb57986c0ca55745fb3e8;p=thirdparty%2Fntp.git [Bug 233] Apply rest of patch from Matthias Drochner bk: 40fcbb04s_XdLW-JEmpNRfY9uYPHiQ --- diff --git a/ntpd/refclock_shm.c b/ntpd/refclock_shm.c index 4ab0eded86..8491c28de1 100644 --- a/ntpd/refclock_shm.c +++ b/ntpd/refclock_shm.c @@ -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; diff --git a/ntpdc/ntpdc_ops.c b/ntpdc/ntpdc_ops.c index 6f6f208061..6ec4ba5552 100644 --- a/ntpdc/ntpdc_ops.c +++ b/ntpdc/ntpdc_ops.c @@ -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",