From ed11c0a6da0cd614ecf3e277ef2a558546c3525a Mon Sep 17 00:00:00 2001 From: XMRig Date: Fri, 20 Sep 2019 02:54:33 +0700 Subject: [PATCH] Fixed config file permissions after write (MSYS only). --- src/base/io/json/Json_win.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/base/io/json/Json_win.cpp b/src/base/io/json/Json_win.cpp index 73aff2c59..cb6f02f64 100644 --- a/src/base/io/json/Json_win.cpp +++ b/src/base/io/json/Json_win.cpp @@ -28,6 +28,7 @@ #ifdef __GNUC__ # include +# include # include #endif @@ -102,7 +103,7 @@ bool xmrig::Json::save(const char *fileName, const rapidjson::Document &doc) return false; } # elif defined(__GNUC__) - const int fd = _wopen(toUtf16(fileName).c_str(), _O_WRONLY | _O_BINARY | _O_CREAT | _O_TRUNC); + const int fd = _wopen(toUtf16(fileName).c_str(), _O_WRONLY | _O_BINARY | _O_CREAT | _O_TRUNC, _S_IWRITE); if (fd == -1) { return false; }