From 82dfc87c85f00acfa0d46369ae3f66c26a93f502 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 8 Jul 2016 15:12:31 +0200 Subject: datatype: time_type should send milliseconds to userspace Kernel expects milliseconds, so fix this datatype to use milliseconds instead of seconds. Signed-off-by: Pablo Neira Ayuso --- src/datatype.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/datatype.c') diff --git a/src/datatype.c b/src/datatype.c index 40e14c93..002c4c66 100644 --- a/src/datatype.c +++ b/src/datatype.c @@ -883,7 +883,7 @@ struct error_record *time_parse(const struct location *loc, const char *str, static void time_type_print(const struct expr *expr) { - time_print(mpz_get_uint64(expr->value)); + time_print(mpz_get_uint64(expr->value) / MSEC_PER_SEC); } static struct error_record *time_type_parse(const struct expr *sym, @@ -896,6 +896,7 @@ static struct error_record *time_type_parse(const struct expr *sym, if (erec != NULL) return erec; + s *= MSEC_PER_SEC; if (s > UINT32_MAX) return error(&sym->location, "value too large"); -- cgit v1.2.3