Core/File: Fix error handling when opening file on posix
This commit is contained in:
parent
377dd992b9
commit
ffa6d5c4cc
|
|
@ -76,6 +76,11 @@ namespace Nz
|
||||||
flags |= O_TRUNC;
|
flags |= O_TRUNC;
|
||||||
|
|
||||||
m_fileDescriptor = open64(filePath.GetConstBuffer(), flags, permissions);
|
m_fileDescriptor = open64(filePath.GetConstBuffer(), flags, permissions);
|
||||||
|
if (m_fileDescriptor == -1)
|
||||||
|
{
|
||||||
|
NazaraError("Failed to open \"" + filePath + "\" : " + Error::GetLastSystemError());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static struct flock lock;
|
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)
|
std::size_t FileImpl::Read(void* buffer, std::size_t size)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue