summaryrefslogtreecommitdiff
path: root/ntpshm.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2012-04-04 16:05:28 -0700
committerGary E. Miller <gem@rellim.com>2012-04-04 16:05:28 -0700
commit7a96e8dd4ff638c12b0d7f443c2b023200828974 (patch)
tree3de74620e00f789d708144868ad8ae28939e46d3 /ntpshm.c
parent4debaea5de11318f5ae9c48aba8bab6dac618d26 (diff)
downloadgpsd-7a96e8dd4ff638c12b0d7f443c2b023200828974.tar.gz
Log the last way PPS thread can exit silently.
Diffstat (limited to 'ntpshm.c')
-rw-r--r--ntpshm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ntpshm.c b/ntpshm.c
index 0bb538cb..73df6524 100644
--- a/ntpshm.c
+++ b/ntpshm.c
@@ -627,10 +627,15 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
* is that no GPS lights up more than one of these pins. By waiting on
* all of them we remove a configuration switch.
*/
- while (ioctl(session->gpsdata.gps_fd, TIOCMIWAIT, PPS_LINE_TIOC) == 0) {
+ while (1) {
int ok = 0;
char *log = NULL;
+ if (ioctl(session->gpsdata.gps_fd, TIOCMIWAIT, PPS_LINE_TIOC) != 0) {
+ gpsd_report(LOG_ERROR, "PPS ioctl(TIOCMIWAIT) failed\n");
+ break;
+ }
+
/*@-noeffect@*/
#ifdef HAVE_CLOCK_GETTIME
/* using clock_gettime() here, that is nSec,