summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2013-03-03 19:18:04 -0600
committerJordan Woyak <jordan.woyak@gmail.com>2013-03-03 19:20:35 -0600
commit814c2ffdfd213dfa78078471d298e2657b7e14e9 (patch)
tree08fd3277db552867f251bed449400f68387ac6f6 /Source/Core
parent989f0663eb212164e11e80626fa89900d2f1ae3e (diff)
Fix some leaking file handles and buildfix probably.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/Src/ArmCPUDetect.cpp17
-rw-r--r--Source/Core/Common/Src/Crypto/md5.cpp2
-rw-r--r--Source/Core/Common/Src/Crypto/sha1.cpp2
3 files changed, 11 insertions, 10 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;
diff --git a/Source/Core/Common/Src/Crypto/md5.cpp b/Source/Core/Common/Src/Crypto/md5.cpp
index ef31636aea..7b8dc149f4 100644
--- a/Source/Core/Common/Src/Crypto/md5.cpp
+++ b/Source/Core/Common/Src/Crypto/md5.cpp
@@ -37,7 +37,7 @@
#include <string.h>
#include <stdio.h>
-#include "FileUtil.h"
+#include "../FileUtil.h"
/*
* 32-bit integer manipulation macros (little endian)
diff --git a/Source/Core/Common/Src/Crypto/sha1.cpp b/Source/Core/Common/Src/Crypto/sha1.cpp
index 3d26dc8a50..45b88b2b6e 100644
--- a/Source/Core/Common/Src/Crypto/sha1.cpp
+++ b/Source/Core/Common/Src/Crypto/sha1.cpp
@@ -36,7 +36,7 @@
#include <string.h>
#include <stdio.h>
-#include "FileUtil.h"
+#include "../FileUtil.h"
/*
* 32-bit integer manipulation macros (big endian)