diff --git a/Core/FileSystems/DirectoryFileSystem.cpp b/Core/FileSystems/DirectoryFileSystem.cpp index 83440ed5cc..35bd4cec6e 100644 --- a/Core/FileSystems/DirectoryFileSystem.cpp +++ b/Core/FileSystems/DirectoryFileSystem.cpp @@ -381,9 +381,13 @@ void DirectoryFileHandle::Close() if (needsTrunc_ != -1) { #ifdef _WIN32 Seek((s32)needsTrunc_, FILEMOVE_BEGIN); - SetEndOfFile(hFile); + if (SetEndOfFile(hFile) == 0) { + ERROR_LOG_REPORT(FILESYS, "Failed to truncate file."); + } #else - ftruncate(hFile, (off_t)needsTrunc_); + if (ftruncate(hFile, (off_t)needsTrunc_) != 0) { + ERROR_LOG_REPORT(FILESYS, "Failed to truncate file."); + } #endif } #ifdef _WIN32