Core/File: Fix error handling when opening file on posix
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user