GPS driver: Check return value of settime and notify shell if call fails

This commit is contained in:
Lorenz Meier 2015-01-04 00:08:04 +01:00
parent 48a8ea7f19
commit c1f89dbd5c
1 changed files with 3 additions and 1 deletions

View File

@ -826,7 +826,9 @@ UBX::payload_rx_done(void)
timespec ts;
ts.tv_sec = epoch;
ts.tv_nsec = _buf.payload_rx_nav_timeutc.nano;
clock_settime(CLOCK_REALTIME, &ts);
if (clock_settime(CLOCK_REALTIME, &ts)) {
warn("failed setting clock");
}
_gps_position->time_gps_usec = ((uint64_t)epoch) * 1000000ULL;
_gps_position->time_gps_usec += _buf.payload_rx_nav_timeutc.nano / 1000;