summaryrefslogtreecommitdiff
path: root/gpsmon.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-11-17 09:36:34 -0500
committerEric S. Raymond <esr@thyrsus.com>2013-11-17 09:36:34 -0500
commit102f05a4e93d592386b40974bea0b3f5a8d648da (patch)
treefd1b1da79910114c821217d8eda5039c7cbabe0c /gpsmon.c
parenta7c3cf50d4533fd1d01be4dffcdaaffb9a9d1ac8 (diff)
downloadgpsd-102f05a4e93d592386b40974bea0b3f5a8d648da.tar.gz
Fix up the pps=no build. All regression tests pass.
Diffstat (limited to 'gpsmon.c')
-rw-r--r--gpsmon.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gpsmon.c b/gpsmon.c
index 27fb44f2..f61d684c 100644
--- a/gpsmon.c
+++ b/gpsmon.c
@@ -669,6 +669,7 @@ static void gpsmon_hook(struct gps_device_t *device, gps_mask_t changed UNUSED)
{
char buf[BUFSIZ];
+#ifdef PPS_ENABLE
if (!serial && strncmp((char*)device->packet.outbuffer, "{\"class\":\"PPS\",", 13) == 0)
{
const char *end;
@@ -687,6 +688,7 @@ static void gpsmon_hook(struct gps_device_t *device, gps_mask_t changed UNUSED)
}
}
else
+#endif /* PPS_ENABLE */
{
(void)snprintf(buf, sizeof(buf), "(%d) ",
(int)device->packet.outbuflen);
@@ -1235,7 +1237,9 @@ int main(int argc, char **argv)
int st = read(0, &inbuf, 1);
if (st == 1) {
+#ifdef PPS_ENABLE
gpsd_acquire_reporting_lock();
+#endif /* PPS_ENABLE*/
tcflush(0, TCIFLUSH);
tcsetattr(0, TCSANOW, &cooked);
(void)fputs("gpsmon> ", stdout);
@@ -1249,7 +1253,9 @@ int main(int argc, char **argv)
if (!curses_active) {
sleep(2);
tcsetattr(0, TCSANOW, &rare);
+#ifdef PPS_ENABLE
gpsd_release_reporting_lock();
+#endif /* PPS_ENABLE*/
}
}
}