Core/File: Fix error handling when opening file on posix

This commit is contained in:
Jérôme Leclercq
2017-11-29 15:12:17 +01:00
parent 377dd992b9
commit ffa6d5c4cc

View File

@@ -76,6 +76,11 @@ namespace Nz
flags |= O_TRUNC;
m_fileDescriptor = open64(filePath.GetConstBuffer(), flags, permissions);
if (m_fileDescriptor == -1)
{
NazaraError("Failed to open \"" + filePath + "\" : " + Error::GetLastSystemError());
return false;
}
static struct flock lock;
@@ -116,7 +121,7 @@ namespace Nz
}
}
return m_fileDescriptor != -1;
return true;
}
std::size_t FileImpl::Read(void* buffer, std::size_t size)