Misc: Backports from PCSX2 UI

This commit is contained in:
Connor McLaughlin
2022-10-23 14:09:54 +10:00
parent 8438506206
commit 72dfbaf6cc
37 changed files with 1037 additions and 271 deletions

View File

@ -1922,14 +1922,22 @@ FileSystem::POSIXLock::POSIXLock(int fd)
}
else
{
Log_ErrorPrintf("lockf() failed: %d", fd);
Log_ErrorPrintf("lockf() failed: %d", errno);
m_fd = -1;
}
}
FileSystem::POSIXLock::POSIXLock(std::FILE* fp)
{
POSIXLock(fileno(fp));
m_fd = fileno(fp);
if (m_fd >= 0)
{
if (lockf(m_fd, F_LOCK, 0) != 0)
{
Log_ErrorPrintf("lockf() failed: %d", errno);
m_fd = -1;
}
}
}
FileSystem::POSIXLock::~POSIXLock()