diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2015-11-04 13:25:10 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2015-11-04 13:25:10 +0100 |
commit | f65d7a9e12d5e6d6e8e67349755c22dc0b656674 (patch) | |
tree | 2a238ac8e3789a16bd88e753bc56a976a20ba483 | |
parent | 91da5993cd0adb698002afb674246ae36d629055 (diff) |
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 <tklauser@distanz.ch>
-rw-r--r-- | flowtop.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) |