From 6293abf4b450e8403111894b1d7047e92bbb3ef3 Mon Sep 17 00:00:00 2001 From: José Bollo Date: Sat, 19 May 2018 01:45:36 +0200 Subject: afb-trace: Restore microsecond time MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allow to use accurately float 64 bits for times from 1970 to 2112. Change-Id: I8f57a57edbf5469f827c0eeb80191de934d9841e Signed-off-by: José Bollo --- src/afb-trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- cgit 1.2.3-korg