From 2ec41070da3f74ecdbafcc992de9e0be6882c96b Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Sun, 12 Apr 2020 12:34:01 -0700 Subject: [PATCH] Ensure that anything opened with openat is tracked in our FD map Missing this was an accident, this was how it was supposed to be. It's very helpful to map FDs to filenames when tracking mmap mappings --- External/FEXCore/Source/Interface/HLE/FileManagement.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/External/FEXCore/Source/Interface/HLE/FileManagement.cpp b/External/FEXCore/Source/Interface/HLE/FileManagement.cpp index e80be7ad2..50dfb51a4 100644 --- a/External/FEXCore/Source/Interface/HLE/FileManagement.cpp +++ b/External/FEXCore/Source/Interface/HLE/FileManagement.cpp @@ -140,11 +140,11 @@ uint64_t FileManager::Openat([[maybe_unused]] int dirfs, const char *pathname, i if (fd == -1) fd = ::openat(dirfs, pathname, flags, mode); - - return fd; } - FDToNameMap[fd] = pathname; + if (fd != -1) + FDToNameMap[fd] = pathname; + return fd; }