1
0
mirror of synced 2024-09-25 03:58:27 +02:00

fix: More invalid use of file io functions on Unix

This commit is contained in:
WerWolv 2021-07-27 22:04:46 +02:00
parent af1d687758
commit fcb00292a5

View File

@ -106,7 +106,7 @@ namespace hex::prv {
#else
auto handle = ::open(this->m_path.data(), 0644);
truncate(handle, newSize - 1);
ftruncate(handle, newSize - 1);
close(handle);
#endif
@ -196,7 +196,7 @@ namespace hex::prv {
ProjectFile::setFilePath(this->m_path);
#else
this->m_file = ::open(path.data(), O_RDWR);
this->m_file = ::open(this->m_path.data(), O_RDWR);
if (this->m_file == -1) {
this->m_file = ::open(path.data(), O_RDONLY);
this->m_writable = false;