From b4c23c969aba6994c5b47dee5c679930606e6e90 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Wed, 27 Dec 2023 21:11:01 +0100 Subject: [PATCH] Fix `unlink` usag on Unix systems to properly use returned value #2078 --- Source/Engine/Platform/Android/AndroidFileSystem.cpp | 2 +- Source/Engine/Platform/Apple/AppleFileSystem.cpp | 2 +- Source/Engine/Platform/Linux/LinuxFileSystem.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Engine/Platform/Android/AndroidFileSystem.cpp b/Source/Engine/Platform/Android/AndroidFileSystem.cpp index a04fc0229..6ea5b394b 100644 --- a/Source/Engine/Platform/Android/AndroidFileSystem.cpp +++ b/Source/Engine/Platform/Android/AndroidFileSystem.cpp @@ -244,7 +244,7 @@ bool AndroidFileSystem::FileExists(const StringView& path) bool AndroidFileSystem::DeleteFile(const StringView& path) { const StringAsANSI<> pathANSI(*path, path.Length()); - return unlink(pathANSI.Get()) == 0; + return unlink(pathANSI.Get()) != 0; } uint64 AndroidFileSystem::GetFileSize(const StringView& path) diff --git a/Source/Engine/Platform/Apple/AppleFileSystem.cpp b/Source/Engine/Platform/Apple/AppleFileSystem.cpp index 9e306019a..0d36f1dfb 100644 --- a/Source/Engine/Platform/Apple/AppleFileSystem.cpp +++ b/Source/Engine/Platform/Apple/AppleFileSystem.cpp @@ -218,7 +218,7 @@ bool AppleFileSystem::FileExists(const StringView& path) bool AppleFileSystem::DeleteFile(const StringView& path) { const StringAsANSI<> pathANSI(*path, path.Length()); - return unlink(pathANSI.Get()) == 0; + return unlink(pathANSI.Get()) != 0; } uint64 AppleFileSystem::GetFileSize(const StringView& path) diff --git a/Source/Engine/Platform/Linux/LinuxFileSystem.cpp b/Source/Engine/Platform/Linux/LinuxFileSystem.cpp index 97cde4a1c..23d47a029 100644 --- a/Source/Engine/Platform/Linux/LinuxFileSystem.cpp +++ b/Source/Engine/Platform/Linux/LinuxFileSystem.cpp @@ -364,7 +364,7 @@ bool LinuxFileSystem::FileExists(const StringView& path) bool LinuxFileSystem::DeleteFile(const StringView& path) { const StringAsANSI<> pathANSI(*path, path.Length()); - return unlink(pathANSI.Get()) == 0; + return unlink(pathANSI.Get()) != 0; } uint64 LinuxFileSystem::GetFileSize(const StringView& path)