Commit 87c0770c authored by Gabi Melman's avatar Gabi Melman

Update os.h

Provide shared read access to log files under windows
parent 137e3541
...@@ -120,7 +120,8 @@ constexpr inline unsigned short eol_size() ...@@ -120,7 +120,8 @@ constexpr inline unsigned short eol_size()
inline int fopen_s(FILE** fp, const std::string& filename, const char* mode) inline int fopen_s(FILE** fp, const std::string& filename, const char* mode)
{ {
#ifdef _WIN32 #ifdef _WIN32
return ::fopen_s(fp, filename.c_str(), mode); *fp = _fsopen((filename.c_str()), mode, _SH_DENYWR);
return *fp == nullptr;
#else #else
*fp = fopen((filename.c_str()), mode); *fp = fopen((filename.c_str()), mode);
return *fp == nullptr; return *fp == nullptr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment