From d4e484e98271868c1bb40b2a9251603d13f0b8a5 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 27 Jul 2021 21:49:17 +0200 Subject: [PATCH] fix: File creation on Unix caused compile errors --- source/providers/file_provider.cpp | 2 +- source/views/view_hexeditor.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/providers/file_provider.cpp b/source/providers/file_provider.cpp index 5569471e3..cd026d899 100644 --- a/source/providers/file_provider.cpp +++ b/source/providers/file_provider.cpp @@ -104,7 +104,7 @@ namespace hex::prv { ::CloseHandle(handle); } #else - auto handle = ::open(path.data(), O_RDWR | O_CREAT); + auto handle = ::open(this->m_path.data(), 0644); truncate(handle, newSize - 1); diff --git a/source/views/view_hexeditor.cpp b/source/views/view_hexeditor.cpp index 9a2f0d87c..34b1487f9 100644 --- a/source/views/view_hexeditor.cpp +++ b/source/views/view_hexeditor.cpp @@ -641,7 +641,7 @@ namespace hex { ::SetEndOfFile(handle); ::CloseHandle(handle); #else - auto handle = ::open(path.data(), O_RDWR | O_CREAT); + auto handle = ::open(path.data(), O_RDWR | O_CREAT, 0644); if (handle == -1) return false;