aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/auxstats
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-04-29 17:13:24 +0000
committerrsc <devnull@localhost>2004-04-29 17:13:24 +0000
commitbe36ff68854c86247fdc769c0eaa89eb284b5ca7 (patch)
treea523e17071eb0e3088f906446b158b3d184b77fe /src/cmd/auxstats
parent3d72637f9b4c42b1fc9b7d95d278ea3dd65c748d (diff)
downloadplan9port-be36ff68854c86247fdc769c0eaa89eb284b5ca7.tar.gz
plan9port-be36ff68854c86247fdc769c0eaa89eb284b5ca7.tar.bz2
plan9port-be36ff68854c86247fdc769c0eaa89eb284b5ca7.zip
add -W to specify window size.
various other little fixes.
Diffstat (limited to 'src/cmd/auxstats')
-rw-r--r--src/cmd/auxstats/Linux.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/cmd/auxstats/Linux.c b/src/cmd/auxstats/Linux.c
index d4c2a29c..afd88407 100644
--- a/src/cmd/auxstats/Linux.c
+++ b/src/cmd/auxstats/Linux.c
@@ -109,21 +109,20 @@ xnet(int first)
totinb = 0;
totoub = 0;
for(i=0; i<nline; i++){
+ if((q = strchr(line[i], ':')) != nil)
+ *q = ' ';
tokens(i);
if(ntok < 8+8)
continue;
if(strncmp(tok[0], "eth", 3) != 0)
continue;
- q = strchr(tok[0], ':');
- *q++ = 0;
- tok[0] = q;
- inb = atoll(tok[0]);
- oub = atoll(tok[8]);
- in = atoll(tok[1]);
- ou = atoll(tok[9]);
+ inb = atoll(tok[1]);
+ oub = atoll(tok[9]);
+ in = atoll(tok[2]);
+ ou = atoll(tok[10]);
b = inb+oub;
p = in+ou;
- e = atoll(tok[2])+atoll(tok[10]);
+ e = atoll(tok[3])+atoll(tok[11]);
totb += b;
totp += p;
tote += e;