Merge pull request #5773 from lioncash/fdres

ThreadManager: Fix error return values in FrontendAllocateSlots()
This commit is contained in:
Ryan Houdek authored and GitHub committed 2026-07-19 16:14:50 -07:00
commit 99b8df4e6f
1 file changed
+7 -9
@@ -86,19 +86,17 @@ uint32_t ThreadManager::StatAlloc::FrontendAllocateSlots(uint32_t NewSize) {
if (ftruncate(fd, NewSize) == -1) {
LogMan::Msg::EFmt("[StatAlloc] ftruncate more failed");
goto err;
close(fd);
return CurrentSize;
}
{
auto SharedBase = FEXCore::Allocator::mmap(Base, NewSize, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, fd, 0);
if (SharedBase == MAP_FAILED) {
LogMan::Msg::EFmt("[StatAlloc] allocate more mmap shm failed");
goto err;
}
auto SharedBase = FEXCore::Allocator::mmap(Base, NewSize, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, fd, 0);
if (SharedBase == MAP_FAILED) {
LogMan::Msg::EFmt("[StatAlloc] allocate more mmap shm failed");
close(fd);
return CurrentSize;
}
err:
close(fd);
return NewSize;
}