0
0
mirror of https://github.com/termux/termux-packages.git synced 2024-12-11 23:00:52 +00:00
termux-packages/packages/boinc/lib-procinfo_unix.cpp.patch

15 lines
378 B
Diff

--- a/lib/procinfo_unix.cpp
+++ b/lib/procinfo_unix.cpp
@@ -268,6 +268,11 @@
// see https://www.baeldung.com/linux/get-cpu-usage
//
double total_cpu_time() {
+#ifdef __ANDROID__
+// /proc/stat is inaccessible under modern Android
+// so always return 0 instead of spamming error
+ return 0;
+#endif
char buf[1024];
static FILE *f=NULL;
static double scale;