From 7b8c6ae432dafda5dcc36967b9c122fb547b4e55 Mon Sep 17 00:00:00 2001 From: ftrvxmtrx Date: Mon, 24 Oct 2016 23:51:16 +0200 Subject: stats: alternatively read battery and temp from aux/acpi --- sys/src/cmd/stats.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/src/cmd/stats.c b/sys/src/cmd/stats.c index 5ded341d6..707169f0f 100644 --- a/sys/src/cmd/stats.c +++ b/sys/src/cmd/stats.c @@ -598,6 +598,10 @@ initmach(Machine *m, char *name) snprint(buf, sizeof buf, "%s/mnt/apm/battery", mpt); m->batteryfd = open(buf, OREAD); + if(m->batteryfd < 0){ + snprint(buf, sizeof buf, "%s/mnt/acpi/battery", mpt); + m->batteryfd = open(buf, OREAD); + } m->bitsybatfd = -1; if(m->batteryfd >= 0){ if(loadbuf(m, &m->batteryfd) && readnums(m, nelem(m->batterystats), a, 0)) @@ -610,6 +614,10 @@ initmach(Machine *m, char *name) } snprint(buf, sizeof buf, "%s/dev/cputemp", mpt); m->tempfd = open(buf, OREAD); + if(m->tempfd < 0){ + snprint(buf, sizeof buf, "%s/mnt/acpi/cputemp", mpt); + m->tempfd = open(buf, OREAD); + } if(loadbuf(m, &m->tempfd)) for(n=0; n < nelem(m->temp) && readnums(m, 2, a, 0); n++) m->temp[n] = a[0]; -- cgit v1.2.3