summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-09-11 06:02:45 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-09-13 15:11:23 +0200
commit519e7013be9519113117221e6f00404d8685be51 (patch)
tree32479fcf58c25c9fe173978a816b62bc1e174daa /src
parenttravis cache for cmake and sdl2 (#2060) (diff)
downloadyuzu-519e7013be9519113117221e6f00404d8685be51.tar
yuzu-519e7013be9519113117221e6f00404d8685be51.tar.gz
yuzu-519e7013be9519113117221e6f00404d8685be51.tar.bz2
yuzu-519e7013be9519113117221e6f00404d8685be51.tar.lz
yuzu-519e7013be9519113117221e6f00404d8685be51.tar.xz
yuzu-519e7013be9519113117221e6f00404d8685be51.tar.zst
yuzu-519e7013be9519113117221e6f00404d8685be51.zip
Diffstat (limited to 'src')
-rw-r--r--src/common/file_util.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp
index 84fe95c8c..bc83ab737 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -457,14 +457,12 @@ bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string &directo
do {
const std::string virtual_name(Common::UTF16ToUTF8(ffd.cFileName));
#else
- struct dirent dirent, *result = nullptr;
-
DIR *dirp = opendir(directory.c_str());
if (!dirp)
return false;
// non windows loop
- while (!readdir_r(dirp, &dirent, &result) && result) {
+ while (struct dirent* result = readdir(dirp)) {
const std::string virtual_name(result->d_name);
#endif
@@ -560,12 +558,10 @@ void CopyDir(const std::string &source_path, const std::string &dest_path)
if (!FileUtil::Exists(source_path)) return;
if (!FileUtil::Exists(dest_path)) FileUtil::CreateFullPath(dest_path);
- struct dirent dirent, *result = nullptr;
DIR *dirp = opendir(source_path.c_str());
if (!dirp) return;
- while (!readdir_r(dirp, &dirent, &result) && result)
- {
+ while (struct dirent* result = readdir(dirp)) {
const std::string virtualName(result->d_name);
// check for "." and ".."
if (((virtualName[0] == '.') && (virtualName[1] == '\0')) ||