mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-05 21:07:52 +00:00
Merge branch 'master' of git.omp.am:/home/omp/git/conky
This commit is contained in:
commit
2d524ce450
11
src/linux.c
11
src/linux.c
@ -319,6 +319,7 @@ void update_net_stats(void)
|
|||||||
{
|
{
|
||||||
FILE *net_dev_fp;
|
FILE *net_dev_fp;
|
||||||
static int rep = 0;
|
static int rep = 0;
|
||||||
|
static char first = 1;
|
||||||
|
|
||||||
// FIXME: arbitrary size chosen to keep code simple.
|
// FIXME: arbitrary size chosen to keep code simple.
|
||||||
int i, i2;
|
int i, i2;
|
||||||
@ -442,9 +443,12 @@ void update_net_stats(void)
|
|||||||
|
|
||||||
/*** end ip addr patch ***/
|
/*** end ip addr patch ***/
|
||||||
|
|
||||||
/* calculate speeds */
|
if (!first) {
|
||||||
ns->net_rec[0] = (ns->recv - last_recv) / delta;
|
/* calculate speeds */
|
||||||
ns->net_trans[0] = (ns->trans - last_trans) / delta;
|
ns->net_rec[0] = (ns->recv - last_recv) / delta;
|
||||||
|
ns->net_trans[0] = (ns->trans - last_trans) / delta;
|
||||||
|
}
|
||||||
|
|
||||||
curtmp1 = 0;
|
curtmp1 = 0;
|
||||||
curtmp2 = 0;
|
curtmp2 = 0;
|
||||||
// get an average
|
// get an average
|
||||||
@ -525,6 +529,7 @@ void update_net_stats(void)
|
|||||||
free(winfo);
|
free(winfo);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
first = 0;
|
||||||
|
|
||||||
fclose(net_dev_fp);
|
fclose(net_dev_fp);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user