From 240da1ffb18e11588cb695e5a0c59ae59096440d Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 8 Oct 2008 13:06:03 +0000 Subject: [PATCH] Wrong access and share flags when opening a file for writing (not creation) on Windows. --- src/common/mm_io.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/mm_io.cpp b/src/common/mm_io.cpp index 160948dcb..dbeeb49e0 100644 --- a/src/common/mm_io.cpp +++ b/src/common/mm_io.cpp @@ -276,9 +276,9 @@ mm_file_io_c::mm_file_io_c(const string &path, disposition = OPEN_EXISTING; break; case MODE_WRITE: - access_mode = GENERIC_WRITE; - share_mode = 0; - disposition = OPEN_ALWAYS; + access_mode = GENERIC_WRITE | GENERIC_READ; + share_mode = FILE_SHARE_READ | FILE_SHARE_WRITE; + disposition = OPEN_EXISTING; break; case MODE_SAFE: access_mode = GENERIC_WRITE | GENERIC_READ;