phc2sys: allow PPS loop only with system clock.

The PPS time stamps are always made by the system clock, don't allow
running the PPS loop with other clocks.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
master
Miroslav Lichvar 2013-01-17 18:31:40 +01:00 committed by Richard Cochran
parent c5ce4ef764
commit 24a1a6a81e
2 changed files with 4 additions and 2 deletions

View File

@ -54,7 +54,8 @@ should be already close to the correct time before
.B phc2sys
is started or the
.B \-s
option should be used too.
option should be used too. This option can be used only with the system clock as
the slave clock.
.TP
.BI \-s " phc-device"
Specify the master clock by device (e.g. /dev/ptp0) or name (e.g. CLOCK_REALTIME

View File

@ -378,7 +378,8 @@ int main(int argc, char *argv[])
src = clock_open(phc_device);
}
if (!(device || src != CLOCK_INVALID) ||
dst_clock.clkid == CLOCK_INVALID) {
dst_clock.clkid == CLOCK_INVALID ||
(device && dst_clock.clkid != CLOCK_REALTIME)) {
usage(progname);
return -1;
}