From: Miroslav Lichvar Date: Fri, 15 Nov 2013 09:08:20 +0000 (+0100) Subject: Fix compilation of PHC driver on systems without PTP_SYS_OFFSET X-Git-Tag: 1.30-pre1~181 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba1d548cc88a6c0aafacccf6bf4875d4cdd93b5b;p=thirdparty%2Fchrony.git Fix compilation of PHC driver on systems without PTP_SYS_OFFSET --- diff --git a/refclock_phc.c b/refclock_phc.c index a1bfd3d1..195c501d 100644 --- a/refclock_phc.c +++ b/refclock_phc.c @@ -63,7 +63,7 @@ static double diff_ts(struct timespec *ts1, struct timespec *ts2) static int read_phc_ioctl(struct phc_reading *readings, int phc_fd, int n) { -#ifdef PTP_SYS_OFFSET +#if defined(PTP_SYS_OFFSET) && NUM_READINGS <= PTP_MAX_SAMPLES struct ptp_sys_offset sys_off; int i; @@ -151,7 +151,7 @@ static int phc_poll(RCL_Instance instance) phc_fd = (long)RCL_GetDriverData(instance); - if (!no_sys_offset_ioctl && NUM_READINGS <= PTP_MAX_SAMPLES) { + if (!no_sys_offset_ioctl) { if (!read_phc_ioctl(readings, phc_fd, NUM_READINGS)) { no_sys_offset_ioctl = 1; return 0;