commit - e683bdfa76a5c2c54422a6bd2934b133d77ba610
commit + 0ac2a105ae58e86a8d224020f0a3c43358312e66
blob - 7bc4b7206881f4756cf9a951ba4f21275e4b8240
blob + e402655115f19fb92b93a97aef7e0e47a45ce6ec
--- src/cmd/auxstats/Linux.c
+++ src/cmd/auxstats/Linux.c
#include <u.h>
#include <libc.h>
#include <bio.h>
+#include <regexp.h>
#include "dat.h"
void xapm(int);
xwireless(int first)
{
static int fd = -1;
+ static Reprog *wlan = nil;
int i;
if(first){
fd = open("/proc/net/wireless", OREAD);
+ wlan = regcomp("^(wlan[0-9]+|wlp[0-9]+s[0-9]+):$");
return;
}
tokens(i);
if(ntok < 3)
continue;
- if(strcmp(tok[0], "wlan0:") == 0)
+ if(regexec(wlan, tok[0], nil, 0) == 1)
Bprint(&bout, "802.11 =%lld 100\n", atoll(tok[2]));
}
}