diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-03-09 04:45:05 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-03-09 04:45:05 -0400 |
commit | 2c203f08a1a9786ae2b18fee6e84ded43ab22a29 (patch) | |
tree | 96c78fd99b35773cd8d4a2b58c04f923d1162c18 | |
parent | 0e47749c2fa1082463259881585e7f28443f54bc (diff) | |
download | gpsd-2c203f08a1a9786ae2b18fee6e84ded43ab22a29.tar.gz |
Fix building with timing=on and pps=on. All regression tests pass.
-rw-r--r-- | gpsd_json.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gpsd_json.c b/gpsd_json.c index 3aeb55f2..4b86df43 100644 --- a/gpsd_json.c +++ b/gpsd_json.c @@ -26,6 +26,7 @@ PERMISSIONS #ifdef SOCKET_EXPORT_ENABLE #include "gps_json.h" +#include "timespec_str.h" #include "revision.h" /* *INDENT-OFF* */ @@ -127,9 +128,6 @@ void json_tpv_dump(const struct gps_device_t *session, /*@out@*/ char *reply, size_t replylen) { const struct gps_data_t *gpsdata = &session->gpsdata; -#ifdef TIMING_ENABLE - timestamp_t rtime = timestamp(); -#endif /* TIMING_ENABLE */ assert(replylen > sizeof(char *)); (void)strlcpy(reply, "{\"class\":\"TPV\",", replylen); @@ -191,9 +189,9 @@ void json_tpv_dump(const struct gps_device_t *session, str_appendf(reply, replylen, "\"rtime\":%s,", rtime_str); #ifdef PPS_ENABLE /*@-type -formattype@*/ /* splint is confused about struct timespec */ - if (session->ppscount) { + if (session->pps_thread.ppsout_count) { char ts_str[TIMESPEC_LEN]; - struct timespec clock_tmp = session->ppslast.clock; + struct timespec clock_tmp = session->pps_thread.ppsout_last.clock; timespec_str( &clock_tmp, ts_str, sizeof(ts_str) ); str_appendf(reply, replylen, "\"pps\":%s,", ts_str); } |