summaryrefslogtreecommitdiff
path: root/Source/Core/Common/FileUtil.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2015-04-07 22:15:21 +0200
committerdegasus <wickmarkus@web.de>2015-04-07 22:42:21 +0200
commitef6bdf674f556c0ce9df383a3dc2e8bdc7483a5f (patch)
treea38461de57b18a7db4d0799b542ef69ba522def6 /Source/Core/Common/FileUtil.cpp
parent4796dc80bfa3b6431032492d88322ebc11beec32 (diff)
Common: Remove TLS usage in GetLastErrorMsg
Just return std::string as this code isn't performance critical.
Diffstat (limited to 'Source/Core/Common/FileUtil.cpp')
-rw-r--r--Source/Core/Common/FileUtil.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp
index 966b372a92..6779e62937 100644
--- a/Source/Core/Common/FileUtil.cpp
+++ b/Source/Core/Common/FileUtil.cpp
@@ -97,7 +97,7 @@ bool IsDirectory(const std::string &filename)
if (result < 0)
{
WARN_LOG(COMMON, "IsDirectory: stat failed on %s: %s",
- filename.c_str(), GetLastErrorMsg());
+ filename.c_str(), GetLastErrorMsg().c_str());
return false;
}
@@ -129,14 +129,14 @@ bool Delete(const std::string &filename)
if (!DeleteFile(UTF8ToTStr(filename).c_str()))
{
WARN_LOG(COMMON, "Delete: DeleteFile failed on %s: %s",
- filename.c_str(), GetLastErrorMsg());
+ filename.c_str(), GetLastErrorMsg().c_str());
return false;
}
#else
if (unlink(filename.c_str()) == -1)
{
WARN_LOG(COMMON, "Delete: unlink failed on %s: %s",
- filename.c_str(), GetLastErrorMsg());
+ filename.c_str(), GetLastErrorMsg().c_str());
return false;
}
#endif
@@ -234,7 +234,7 @@ bool DeleteDir(const std::string &filename)
if (rmdir(filename.c_str()) == 0)
return true;
#endif
- ERROR_LOG(COMMON, "DeleteDir: %s: %s", filename.c_str(), GetLastErrorMsg());
+ ERROR_LOG(COMMON, "DeleteDir: %s: %s", filename.c_str(), GetLastErrorMsg().c_str());
return false;
}
@@ -262,7 +262,7 @@ bool Rename(const std::string &srcFilename, const std::string &destFilename)
return true;
#endif
ERROR_LOG(COMMON, "Rename: failed %s --> %s: %s",
- srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg());
+ srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
return false;
}
@@ -311,7 +311,7 @@ bool Copy(const std::string &srcFilename, const std::string &destFilename)
return true;
ERROR_LOG(COMMON, "Copy: failed %s --> %s: %s",
- srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg());
+ srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
return false;
#else
@@ -326,7 +326,7 @@ bool Copy(const std::string &srcFilename, const std::string &destFilename)
if (!input.is_open())
{
ERROR_LOG(COMMON, "Copy: input failed %s --> %s: %s",
- srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg());
+ srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
return false;
}
@@ -336,7 +336,7 @@ bool Copy(const std::string &srcFilename, const std::string &destFilename)
if (!output.IsOpen())
{
ERROR_LOG(COMMON, "Copy: output failed %s --> %s: %s",
- srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg());
+ srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
return false;
}
@@ -349,7 +349,7 @@ bool Copy(const std::string &srcFilename, const std::string &destFilename)
{
ERROR_LOG(COMMON,
"Copy: failed reading from source, %s --> %s: %s",
- srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg());
+ srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
return false;
}
@@ -358,7 +358,7 @@ bool Copy(const std::string &srcFilename, const std::string &destFilename)
{
ERROR_LOG(COMMON,
"Copy: failed writing to output, %s --> %s: %s",
- srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg());
+ srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
return false;
}
}
@@ -395,7 +395,7 @@ u64 GetSize(const std::string &filename)
}
ERROR_LOG(COMMON, "GetSize: Stat failed %s: %s",
- filename.c_str(), GetLastErrorMsg());
+ filename.c_str(), GetLastErrorMsg().c_str());
return 0;
}
@@ -406,7 +406,7 @@ u64 GetSize(const int fd)
if (fstat64(fd, &buf) != 0)
{
ERROR_LOG(COMMON, "GetSize: stat failed %i: %s",
- fd, GetLastErrorMsg());
+ fd, GetLastErrorMsg().c_str());
return 0;
}
return buf.st_size;
@@ -420,7 +420,7 @@ u64 GetSize(FILE *f)
if (fseeko(f, 0, SEEK_END) != 0)
{
ERROR_LOG(COMMON, "GetSize: seek failed %p: %s",
- f, GetLastErrorMsg());
+ f, GetLastErrorMsg().c_str());
return 0;
}
@@ -428,7 +428,7 @@ u64 GetSize(FILE *f)
if ((size != pos) && (fseeko(f, pos, SEEK_SET) != 0))
{
ERROR_LOG(COMMON, "GetSize: seek failed %p: %s",
- f, GetLastErrorMsg());
+ f, GetLastErrorMsg().c_str());
return 0;
}
@@ -443,7 +443,7 @@ bool CreateEmptyFile(const std::string &filename)
if (!File::IOFile(filename, "wb"))
{
ERROR_LOG(COMMON, "CreateEmptyFile: failed %s: %s",
- filename.c_str(), GetLastErrorMsg());
+ filename.c_str(), GetLastErrorMsg().c_str());
return false;
}
@@ -656,7 +656,7 @@ std::string GetCurrentDir()
if (!(dir = __getcwd(nullptr, 0)))
{
ERROR_LOG(COMMON, "GetCurrentDirectory failed: %s",
- GetLastErrorMsg());
+ GetLastErrorMsg().c_str());
return nullptr;
}
std::string strDir = dir;