phc2sys: Use currentUtcOffset only with PTP timescale.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
master
Miroslav Lichvar 2013-05-07 14:32:21 +02:00 committed by Richard Cochran
parent 4a3e5857b1
commit 3414d99609
1 changed files with 11 additions and 8 deletions

View File

@ -368,6 +368,7 @@ static int run_pmc(struct clock *clock, int timeout,
int wait_sync, int get_utc_offset) int wait_sync, int get_utc_offset)
{ {
struct ptp_message *msg; struct ptp_message *msg;
struct timePropertiesDS *tds;
void *data; void *data;
#define N_FD 1 #define N_FD 1
struct pollfd pollfd[N_FD]; struct pollfd pollfd[N_FD];
@ -440,14 +441,16 @@ static int run_pmc(struct clock *clock, int timeout,
break; break;
case TIME_PROPERTIES_DATA_SET: case TIME_PROPERTIES_DATA_SET:
clock->sync_offset = ((struct timePropertiesDS *)data)-> tds = (struct timePropertiesDS *)data;
currentUtcOffset; if (tds->flags & PTP_TIMESCALE) {
if (((struct timePropertiesDS *)data)->flags & LEAP_61) clock->sync_offset = tds->currentUtcOffset;
clock->leap = 1; if (tds->flags & LEAP_61)
else if (((struct timePropertiesDS *)data)->flags & LEAP_59) clock->leap = 1;
clock->leap = -1; else if (tds->flags & LEAP_59)
else clock->leap = -1;
clock->leap = 0; else
clock->leap = 0;
}
ds_done = 1; ds_done = 1;
break; break;
} }