From 68ad3e8db43b54d420d13e7415b182d6b3546b13 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Wed, 2 Aug 2023 15:54:54 +1000 Subject: [PATCH] FileSystem: Partial revert of c82f800 Mixing stdio and raw FD access is a bad thing, filelength() isn't going to return correct results when extending a file has been buffered. --- common/FileSystem.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/common/FileSystem.cpp b/common/FileSystem.cpp index 5c998995eb..e0918d78d6 100644 --- a/common/FileSystem.cpp +++ b/common/FileSystem.cpp @@ -748,13 +748,6 @@ s64 FileSystem::FTell64(std::FILE* fp) s64 FileSystem::FSize64(std::FILE* fp) { -#ifdef _WIN32 - const int fd = _fileno(fp); - if (fd >= 0) - { - return _filelengthi64(fd); - } -#else const s64 pos = FTell64(fp); if (pos >= 0) { @@ -765,7 +758,6 @@ s64 FileSystem::FSize64(std::FILE* fp) return size; } } -#endif return -1; }