diff options
author | Chris Wilson <chris+github@qwirx.com> | 2014-12-26 23:16:46 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2014-12-26 23:16:46 +0000 |
commit | 0b067dfcbc3bfc4fa1415e5e1e2a69cf1a693653 (patch) | |
tree | f5abd94f4826ceb9c1a847c2fa68fe1dc4c59084 /lib/raidfile | |
parent | 0c7bcfc15e2198181b947826e1561c1ea994b74c (diff) |
Fix test failures caused by using plain stat() instead of emu_stat().
On Windows, plain stat() no longer handles slashes in filenames correctly
(since upgrading MinGW? Or switching to 64-bit Windows?). We need to use
POSIX fstat() for now in RaidFile, but we can still use the emu_stat,
and in fact we should, to fix path translation.
Diffstat (limited to 'lib/raidfile')
-rw-r--r-- | lib/raidfile/RaidFileRead.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/raidfile/RaidFileRead.cpp b/lib/raidfile/RaidFileRead.cpp index 1396b4cd..4e7c9567 100644 --- a/lib/raidfile/RaidFileRead.cpp +++ b/lib/raidfile/RaidFileRead.cpp @@ -1498,8 +1498,8 @@ bool RaidFileRead::DirectoryExists(const RaidFileDiscSet &rSet, const std::strin std::string dn(rSet[l] + DIRECTORY_SEPARATOR + rDirName); // check for existence - struct stat st; - if(::stat(dn.c_str(), &st) == 0) + EMU_STRUCT_STAT st; + if(EMU_STAT(dn.c_str(), &st) == 0) { // Directory? if(st.st_mode & S_IFDIR) @@ -1617,9 +1617,9 @@ bool RaidFileRead::ReadDirectoryContents(int SetNumber, const std::string &rDirN #ifdef HAVE_VALID_DIRENT_D_TYPE if(DirReadType == DirReadType_FilesOnly && en->d_type == DT_REG) #else - struct stat st; + EMU_STRUCT_STAT st; std::string fullName(dn + DIRECTORY_SEPARATOR + en->d_name); - if(::lstat(fullName.c_str(), &st) != 0) + if(EMU_LSTAT(fullName.c_str(), &st) != 0) { THROW_EXCEPTION(RaidFileException, OSError) } |