diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-11-12 13:29:42 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-11-12 13:29:42 -0500 |
commit | 9b14a8cd3a90e005c6f5f0708119ad839243d812 (patch) | |
tree | aab33f89d813b41ac885ccfdec8a57bd4f34331e /monitor_nmea.c | |
parent | 663a717e9f50795795f546f77d83db014135fa52 (diff) | |
download | gpsd-9b14a8cd3a90e005c6f5f0708119ad839243d812.tar.gz |
Fix pps=no build.
Diffstat (limited to 'monitor_nmea.c')
-rw-r--r-- | monitor_nmea.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/monitor_nmea.c b/monitor_nmea.c index 4f7d706c..d08f9522 100644 --- a/monitor_nmea.c +++ b/monitor_nmea.c @@ -174,8 +174,9 @@ static void cooked_pvt(void) static void nmea_update(void) { char **fields; +#ifdef PPS_ENABLE struct timedrift_t drift; - double timedelta; +#endif /* PPS_ENABLE */ assert(cookedwin != NULL); assert(nmeawin != NULL); @@ -316,12 +317,15 @@ static void nmea_update(void) } } - pps_thread_lastpps(&session, &drift); - /*@-type@*/ /* splint is confused about struct timespec */ - timedelta = timespec_diff_ns(drift.real, drift.clock) * 1e-9; - /*@+type@*/ - (void)mvwprintw(gpgsawin, 4, 13, "%.9f", timedelta); - wnoutrefresh(gpgsawin); +#ifdef PPS_ENABLE + if (pps_thread_lastpps(&session, &drift) > 0) { + /*@-type@*/ /* splint is confused about struct timespec */ + double timedelta = timespec_diff_ns(drift.real, drift.clock) * 1e-9; + /*@+type@*/ + (void)mvwprintw(gpgsawin, 4, 13, "%.9f", timedelta); + wnoutrefresh(gpgsawin); + } +#endif /* PPS_ENABLE */ } /*@ +globstate +nullpass */ |