From f65d7a9e12d5e6d6e8e67349755c22dc0b656674 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 4 Nov 2015 13:25:10 +0100 Subject: flowtop: Handle return value of gettimeofday() Handle non-zero return values by exiting flowtop like we do in the other tools. This fixes Coverity warnings CID 1338093 and CID 1338092. Signed-off-by: Tobias Klauser --- flowtop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flowtop.c b/flowtop.c index 6fd3c6a..bfb20e9 100644 --- a/flowtop.c +++ b/flowtop.c @@ -227,7 +227,7 @@ static int64_t time_after_us(struct timeval *tv) { struct timeval now; - gettimeofday(&now, NULL); + bug_on(gettimeofday(&now, NULL)); now.tv_sec -= tv->tv_sec; now.tv_usec -= tv->tv_usec; @@ -296,7 +296,7 @@ static void version(void) static void flow_entry_update_time(struct flow_entry *n) { - gettimeofday(&n->last_update, NULL); + bug_on(gettimeofday(&n->last_update, NULL)); } static void flow_entry_calc_rate(struct flow_entry *n, const struct nf_conntrack *ct) -- cgit v1.2.3-54-g00ecf