shithub: riscv

Download patch

ref: 8e9d2434e97fe6cf4b0d3e7f43e3e35d7ae1033f
parent: daf153009e0db3c5fb39a7011f86526c7d863653
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Oct 28 03:10:27 EDT 2018

bcm: provide /dev/cputemp in a format stats can understand

--- a/sys/src/9/bcm/devarch.c
+++ b/sys/src/9/bcm/devarch.c
@@ -160,9 +160,9 @@
 static long
 cputempread(Chan*, void *a, long n, vlong offset)
 {
-	char str[16];
-
-	snprint(str, sizeof str, "%ud\n", (getcputemp()+500)/1000);
+	char str[32];
+	uint t = getcputemp();
+	snprint(str, sizeof str, "%ud.%ud\n", t/1000, t%1000);
 	return readstr(offset, a, n, str);
 }