phc2sys: fix operation without -s option.
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>master
parent
f3b0ca69d3
commit
ce6533fd75
12
phc2sys.c
12
phc2sys.c
|
@ -91,10 +91,6 @@ static int read_phc(clockid_t clkid, clockid_t sysclk, int rdelay, int readings,
|
||||||
int i;
|
int i;
|
||||||
int64_t interval, best_interval = INT64_MAX;
|
int64_t interval, best_interval = INT64_MAX;
|
||||||
|
|
||||||
if (clkid == CLOCK_INVALID) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Pick the quickest clkid reading. */
|
/* Pick the quickest clkid reading. */
|
||||||
for (i = 0; i < readings; i++) {
|
for (i = 0; i < readings; i++) {
|
||||||
if (clock_gettime(sysclk, &tdst1) ||
|
if (clock_gettime(sysclk, &tdst1) ||
|
||||||
|
@ -287,9 +283,11 @@ int main(int argc, char *argv[])
|
||||||
} else
|
} else
|
||||||
usleep(1000000 / phc_rate);
|
usleep(1000000 / phc_rate);
|
||||||
|
|
||||||
if (!read_phc(src, dst, rdelay, phc_readings, &phc_offset, &phc_ts))
|
if (src != CLOCK_INVALID) {
|
||||||
continue;
|
if (!read_phc(src, dst, rdelay, phc_readings, &phc_offset, &phc_ts))
|
||||||
printf("phc %9lld ", phc_offset);
|
continue;
|
||||||
|
printf("phc %9lld ", phc_offset);
|
||||||
|
}
|
||||||
|
|
||||||
if (fd > 0)
|
if (fd > 0)
|
||||||
do_servo(&servo, src, dst, pps_offset, pps_ts, kp, ki);
|
do_servo(&servo, src, dst, pps_offset, pps_ts, kp, ki);
|
||||||
|
|
Loading…
Reference in New Issue