aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xbmc/utils/CPUInfo.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/xbmc/utils/CPUInfo.cpp b/xbmc/utils/CPUInfo.cpp
index f47ab62aac..f3f275f692 100644
--- a/xbmc/utils/CPUInfo.cpp
+++ b/xbmc/utils/CPUInfo.cpp
@@ -685,8 +685,16 @@ bool CCPUInfo::readProcStat(unsigned long long& user, unsigned long long& nice,
if (m_fProcStat == NULL)
return false;
+#ifdef TARGET_ANDROID
+ // Just another (vanilla) NDK quirk:
+ // rewind + fflush do not actually flush the buffers,
+ // the same initial content is returned rather than re-read
+ fclose(m_fProcStat);
+ m_fProcStat = fopen("/proc/stat", "r");
+#else
rewind(m_fProcStat);
fflush(m_fProcStat);
+#endif
char buf[256];
if (!fgets(buf, sizeof(buf), m_fProcStat))