phc2sys: Require either -O or -w on command line

The default zero offset can lead to misalignment between system clocks or wrong
time to be broadcast to the domain.  Therefore we require setting offset upon
invocation.

Signed-off-by: Libor Pechacek <lpechacek@suse.cz>
master
Libor Pechacek 2013-05-17 10:55:49 +02:00 committed by Richard Cochran
parent 6e4734316f
commit a29b3bc4f9
2 changed files with 11 additions and 4 deletions

View File

@ -109,10 +109,10 @@ minimize the error caused by random delays in scheduling and bus utilization.
The default is 5.
.TP
.BI \-O " offset"
Specify the offset between the slave and master times in seconds. The default
is set automatically with the
.B \-w
option, 0 otherwise.
Specify the offset between the slave and master times in seconds. See
.SM
.B TIME SCALE USAGE
below.
.TP
.BI \-u " summary-updates"
Specify the number of clock updates included in summary statistics. The

View File

@ -684,6 +684,13 @@ int main(int argc, char *argv[])
return -1;
}
if (!wait_sync && !forced_sync_offset) {
fprintf(stderr,
"time offset must be specified using -w or -O\n");
usage(progname);
return -1;
}
if (dst_clock.stats_max_count > 0) {
dst_clock.offset_stats = stats_create();
dst_clock.freq_stats = stats_create();