diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2013-03-03 19:18:04 -0600 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2013-03-03 19:20:35 -0600 |
| commit | 814c2ffdfd213dfa78078471d298e2657b7e14e9 (patch) | |
| tree | 08fd3277db552867f251bed449400f68387ac6f6 /Source/Core/Common/Src/ArmCPUDetect.cpp | |
| parent | 989f0663eb212164e11e80626fa89900d2f1ae3e (diff) | |
Fix some leaking file handles and buildfix probably.
Diffstat (limited to 'Source/Core/Common/Src/ArmCPUDetect.cpp')
| -rw-r--r-- | Source/Core/Common/Src/ArmCPUDetect.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/Core/Common/Src/ArmCPUDetect.cpp b/Source/Core/Common/Src/ArmCPUDetect.cpp index c03ab08c48..8b5cbf9b79 100644 --- a/Source/Core/Common/Src/ArmCPUDetect.cpp +++ b/Source/Core/Common/Src/ArmCPUDetect.cpp @@ -18,6 +18,7 @@ #include "Common.h" #include "CPUDetect.h" #include "StringUtil.h" +#include "FileUtil.h" const char procfile[] = "/proc/cpuinfo"; @@ -27,9 +28,9 @@ char *GetCPUString() char *cpu_string = 0; // Count the number of processor lines in /proc/cpuinfo char buf[1024]; - FILE *fp; - fp = fopen(procfile, "r"); + File::IOFile file(procfile, "r"); + auto const fp = file.GetHandle(); if (!fp) return 0; @@ -47,9 +48,9 @@ bool CheckCPUFeature(const char *feature) { const char marker[] = "Features\t: "; char buf[1024]; - FILE *fp; - - fp = fopen(procfile, "r"); + + File::IOFile file(procfile, "r"); + auto const fp = file.GetHandle(); if (!fp) return 0; @@ -73,9 +74,9 @@ int GetCoreCount() const char marker[] = "processor\t: "; int cores = 0; char buf[1024]; - FILE *fp; - - fp = fopen(procfile, "r"); + + File::IOFile file(procfile, "r"); + auto const fp = file.GetHandle(); if (!fp) return 0; |
