mirror of
https://github.com/izzy2lost/ppsspp.git
synced 2026-03-10 12:43:04 -07:00
Log an error if ftruncate() fails.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user