diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-03-07 06:52:03 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-03-07 06:52:03 -0500 |
commit | b044ef0e2ff6c6a392d42e69c6cb5ce1d0b5bbda (patch) | |
tree | 36a2a1be1db9e495e43f2d3b091bfb97d93dfcc4 /gpsmon.c | |
parent | 2eed866084e4553473f63951d89de4490ce0169c (diff) | |
download | gpsd-b044ef0e2ff6c6a392d42e69c6cb5ce1d0b5bbda.tar.gz |
Revert "Another step in prying ntplib loose. Partly decouple ppsthread.c fom sessions."
Previous approch was a bit too frontal.
Diffstat (limited to 'gpsmon.c')
-rw-r--r-- | gpsmon.c | 18 |
1 files changed, 3 insertions, 15 deletions
@@ -249,19 +249,7 @@ void pps_update(WINDOW *win, int y, int x) /*@-type -noeffect@*/ /* splint is confused about struct timespec */ struct timedelta_t ppstimes; - int status = pps_thread_lastpps(&session.pps_state, &ppstimes); - - if (status == PPS_LOCK_ERR) { - char errbuf[BUFSIZ] = "unknown error"; - (void)strerror_r(errno, errbuf,(int) sizeof(errbuf)); - gpsd_report(&session.context->errout, LOG_ERROR, - "PPS: pthread_mutex_unlock() : %s\n", errbuf); - } else if (status == PPS_LOCK_ERR) { - char errbuf[BUFSIZ] = "unknown error"; - (void)strerror_r(errno, errbuf,(int) sizeof(errbuf)); - gpsd_report(&session.context->errout, LOG_ERROR, - "PPS: pthread_mutex_lock() : %s\n", errbuf); - } else { + if (pps_thread_lastpps(&session, &ppstimes) > 0) { /* NOTE: can not use double here due to precision requirements */ struct timespec timedelta; (void)wmove(win, y, x); @@ -802,9 +790,9 @@ static void gpsmon_hook(struct gps_device_t *device, gps_mask_t changed UNUSED) "------------------- PPS offset: %.20s ------\n ", timedelta_str); /* coverity[missing_lock] */ - session.pps_state.ppslast = noclobber.pps; + session.ppslast = noclobber.pps; /* coverity[missing_lock] */ - session.pps_state.ppscount++; + session.ppscount++; } } else |