summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-05-19 01:45:36 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2018-06-13 17:15:35 +0200
commit6293abf4b450e8403111894b1d7047e92bbb3ef3 (patch)
tree283a3127a5d2df6854dfd1beacb763a311517e96
parentb2abd7a2a4eed32845a71138694e7977d08b3d3a (diff)
afb-trace: Restore microsecond time
This allow to use accurately float 64 bits for times from 1970 to 2112. Change-Id: I8f57a57edbf5469f827c0eeb80191de934d9841e Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/afb-trace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/afb-trace.c b/src/afb-trace.c
index f5f9c19e..5404a5af 100644
--- a/src/afb-trace.c
+++ b/src/afb-trace.c
@@ -168,7 +168,7 @@ static struct json_object *timestamp(const struct afb_hookid *hookid)
{
char ts[50];
- snprintf(ts, sizeof ts, "%llu.%09llu", (long long unsigned)hookid->time.tv_sec, (long long unsigned)hookid->time.tv_nsec);
+ snprintf(ts, sizeof ts, "%llu.%06lu", (long long unsigned)hookid->time.tv_sec, (long unsigned)(hookid->time.tv_nsec / 1000));
return json_object_new_string(ts);
}