summaryrefslogtreecommitdiff
path: root/gpsd_json.c
diff options
context:
space:
mode:
Diffstat (limited to 'gpsd_json.c')
-rw-r--r--gpsd_json.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gpsd_json.c b/gpsd_json.c
index 198645e0..5f4f531c 100644
--- a/gpsd_json.c
+++ b/gpsd_json.c
@@ -725,14 +725,15 @@ void json_raw_dump(const struct gps_data_t *gpsdata,
int i;
assert(replylen > sizeof(char *));
- if (0 == isfinite(gpsdata->raw.mtime)) {
+ if (0 == gpsdata->raw.mtime.tv_sec) {
/* no data to dump */
return;
}
(void)strlcpy(reply, "{\"class\":\"RAW\",", replylen);
if (gpsdata->dev.path[0] != '\0')
- str_appendf(reply, replylen, "\"device\":\"%s\",\"time\":%f,",
- gpsdata->dev.path, gpsdata->raw.mtime);
+ str_appendf(reply, replylen, "\"device\":\"%s\",\"time\":%ld.%09ld,",
+ gpsdata->dev.path, (long)gpsdata->raw.mtime.tv_sec,
+ gpsdata->raw.mtime.tv_nsec);
(void)strlcat(reply, "\"rawdata\":[", replylen);
for (i = 0; i < MAXCHANNELS; i++) {