diff options
author | Chris Browet <koying@semperpax.com> | 2013-12-28 12:09:59 -0800 |
---|---|---|
committer | Chris Browet <koying@semperpax.com> | 2013-12-28 12:09:59 -0800 |
commit | f808ac14c5238fe6576fbbf735118d4999d2af5c (patch) | |
tree | b992b15510fb09cc8c2564734eaf94494414fa53 | |
parent | a6301062ad24cba4a6650f89ce2180fc3887574a (diff) | |
parent | d42e229b9eecb5c38256cfbe83e21b588d2cdb92 (diff) |
Merge pull request #3917 from koying/fixdroidcpuload
FIX: [droid] cpu load info with vanilla ndk
-rw-r--r-- | xbmc/utils/CPUInfo.cpp | 8 |
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)) |