summaryrefslogtreecommitdiffstats
path: root/src/OSSupport/File.cpp
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-05-03 15:07:56 +0200
committerTycho <work.tycho+git@gmail.com>2014-05-03 15:07:56 +0200
commitec407dd27dc35b5903fdddf2bad307784842d679 (patch)
tree69c699b9242fcccf4b7ee865b0c6a9842329c0d4 /src/OSSupport/File.cpp
parentcCHunkBuffer that compiles with TestGlobals.h (diff)
parentSeperate instructions for OSX and Linux (diff)
downloadcuberite-ec407dd27dc35b5903fdddf2bad307784842d679.tar
cuberite-ec407dd27dc35b5903fdddf2bad307784842d679.tar.gz
cuberite-ec407dd27dc35b5903fdddf2bad307784842d679.tar.bz2
cuberite-ec407dd27dc35b5903fdddf2bad307784842d679.tar.lz
cuberite-ec407dd27dc35b5903fdddf2bad307784842d679.tar.xz
cuberite-ec407dd27dc35b5903fdddf2bad307784842d679.tar.zst
cuberite-ec407dd27dc35b5903fdddf2bad307784842d679.zip
Diffstat (limited to 'src/OSSupport/File.cpp')
-rw-r--r--src/OSSupport/File.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/OSSupport/File.cpp b/src/OSSupport/File.cpp
index 33b9cfc3f..8c24fa541 100644
--- a/src/OSSupport/File.cpp
+++ b/src/OSSupport/File.cpp
@@ -75,7 +75,7 @@ bool cFile::Open(const AString & iFileName, eMode iMode)
}
#ifdef _WIN32
- fopen_s(&m_File, (FILE_IO_PREFIX + iFileName).c_str(), Mode);
+ m_File = _fsopen((FILE_IO_PREFIX + iFileName).c_str(), Mode, _SH_DENYWR);
#else
m_File = fopen((FILE_IO_PREFIX + iFileName).c_str(), Mode);
#endif // _WIN32
@@ -88,7 +88,7 @@ bool cFile::Open(const AString & iFileName, eMode iMode)
// Simply re-open for read-writing, erasing existing contents:
#ifdef _WIN32
- fopen_s(&m_File, (FILE_IO_PREFIX + iFileName).c_str(), "wb+");
+ m_File = _fsopen((FILE_IO_PREFIX + iFileName).c_str(), "wb+", _SH_DENYWR);
#else
m_File = fopen((FILE_IO_PREFIX + iFileName).c_str(), "wb+");
#endif // _WIN32