diff options
author | Gary E. Miller <gem@rellim.com> | 2012-05-03 15:21:26 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2012-05-03 15:21:26 -0700 |
commit | a9b995654aefe0eeae8ddd9ea7dcc78c63ec6efc (patch) | |
tree | 193e639ccb84e952db971cbde0d3a2415d70e532 /ntpshm.c | |
parent | c7605a1676cc9f7a73b978f38637b3510a96e9af (diff) | |
download | gpsd-a9b995654aefe0eeae8ddd9ea7dcc78c63ec6efc.tar.gz |
Add logging for unlogged NTP error path.
Diffstat (limited to 'ntpshm.c')
-rw-r--r-- | ntpshm.c | 24 |
1 files changed, 16 insertions, 8 deletions
@@ -633,6 +633,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg) while (1) { int ok = 0; char *log = NULL; + char *log1 = NULL; if (ioctl(session->gpsdata.gps_fd, TIOCMIWAIT, PPS_LINE_TIOC) != 0) { gpsd_report(LOG_ERROR, "PPS ioctl(TIOCMIWAIT) failed: %d %.40s\n" @@ -881,16 +882,23 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg) /*@+noeffect@*/ #endif - if ( 0 <= chronyfd && session->ship_to_ntpd) { - (void)send(chronyfd, &sample, sizeof (sample), 0); - gpsd_report(LOG_RAW, "PPS edge accepted chrony sock %lu.%06lu offset %.9f\n", - (unsigned long)sample.tv.tv_sec, - (unsigned long)sample.tv.tv_usec, - sample.offset); - } TSTOTV( &tv, &ts ); - if (session->ship_to_ntpd) + if (session->ship_to_ntpd) { + log1 = "accepted"; + if ( 0 <= chronyfd ) { + log1 = "accepted chrony sock"; + (void)send(chronyfd, &sample, sizeof (sample), 0); + } (void)ntpshm_pps(session, &tv); + } else { + log1 = "skipped ship_to_ntp=0"; + } + gpsd_report(LOG_RAW, + "PPS edge %.20s %lu.%06lu offset %.9f\n", + log1, + (unsigned long)sample.tv.tv_sec, + (unsigned long)sample.tv.tv_usec, + sample.offset); if (session->context->pps_hook != NULL) session->context->pps_hook(session, &tv); } else { |