From 55811b7f5359fc740f6678061d6e038528c2af27 Mon Sep 17 00:00:00 2001 From: Philip Kovacs Date: Sun, 15 Jul 2007 18:21:04 +0000 Subject: [PATCH] Fix displaying 4 GB traffic after reloading network driver, patch #1754260. thanks sohalt. git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@886 7f574dfc-610e-0410-a909-a81674777703 --- ChangeLog | 4 +++- src/linux.c | 8 ++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5f9e0c89..9bb65a3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,9 @@ # $Id$ 2007-07-15 - * Fix PID display, patch #1753934. thanks to sohalt. + * Fix PID display, patch #1753934. thanks sohalt. + * Fix displaying 4 GB traffic after reloading network driver, + patch #1754260. thanks sohalt. 2007-06-21 * Right-justify top/top_mem vars (pid/cpu/mem} so they align on the decimal. diff --git a/src/linux.c b/src/linux.c index c163ae97..ce4b7451 100644 --- a/src/linux.c +++ b/src/linux.c @@ -185,17 +185,13 @@ inline void update_net_stats() /* if recv or trans is less than last time, an overflow happened */ if (r < ns->last_read_recv) - ns->recv += - ((long long) 4294967295U - - ns->last_read_recv) + r; + last_recv = 0; else ns->recv += (r - ns->last_read_recv); ns->last_read_recv = r; if (t < ns->last_read_trans) - ns->trans += - ((long long) 4294967295U - - ns->last_read_trans) + t; + last_trans = 0; else ns->trans += (t - ns->last_read_trans); ns->last_read_trans = t;