diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-04-01 03:02:02 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-04-01 03:02:02 -0400 |
commit | 224469fbfd1dedccb298263173d5fcd199e0f128 (patch) | |
tree | 23dc186e523e83c787e8e259020d062e9ae6a5ab /gpsd_json.c | |
parent | 90e1d453f282f014a959260764431e64a791942d (diff) | |
download | gpsd-224469fbfd1dedccb298263173d5fcd199e0f128.tar.gz |
Properly thread-interlock some timing code.
Diffstat (limited to 'gpsd_json.c')
-rw-r--r-- | gpsd_json.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gpsd_json.c b/gpsd_json.c index f27d29c9..8bbcb45f 100644 --- a/gpsd_json.c +++ b/gpsd_json.c @@ -188,8 +188,11 @@ void json_tpv_dump(const struct gps_device_t *session, #ifdef PPS_ENABLE if (session->pps_thread.ppsout_count) { char ts_str[TIMESPEC_LEN]; - struct timespec clock_tmp = session->pps_thread.ppsout_last.clock; - timespec_str( &clock_tmp, ts_str, sizeof(ts_str) ); + struct timedelta_t timedelta; + /* ugh - de-consting this might get us in trouble someday */ + pps_thread_ppsout(&((struct gps_device_t *)session)->pps_thread, + &timedelta); + timespec_str(&timedelta.clock, ts_str, sizeof(ts_str) ); str_appendf(reply, replylen, "\"pps\":%s,", ts_str); /* TODO: add PPS precision to JSON output */ } |