projects
/
vuplus_xbmc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7827d46
)
FIX: [droid] cpu load info with vanilla ndk
author
Chris "Koying" Browet
<cbro@semperpax.com>
Sat, 28 Dec 2013 19:40:03 +0000
(20:40 +0100)
committer
Chris "Koying" Browet
<cbro@semperpax.com>
Sat, 28 Dec 2013 19:48:33 +0000
(20:48 +0100)
xbmc/utils/CPUInfo.cpp
patch
|
blob
|
history
diff --git
a/xbmc/utils/CPUInfo.cpp
b/xbmc/utils/CPUInfo.cpp
index
f47ab62
..
f3f275f
100644
(file)
--- 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))