Skip to content
Browse files

Merge pull request #3917 from koying/fixdroidcpuload

FIX: [droid] cpu load info with vanilla ndk
  • Loading branch information...
2 parents a630106 + d42e229 commit f808ac14c5238fe6576fbbf735118d4999d2af5c @koying koying committed
Showing with 8 additions and 0 deletions.
  1. +8 −0 xbmc/utils/CPUInfo.cpp
8 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;
+ // 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");
char buf[256];
if (!fgets(buf, sizeof(buf), m_fProcStat))

0 comments on commit f808ac1

Please sign in to comment.
Something went wrong with that request. Please try again.