Wrong access and share flags when opening a file for writing (not creation) on Windows.

This commit is contained in:
Moritz Bunkus 2008-10-08 13:06:03 +00:00
parent 937b885057
commit 240da1ffb1

View File

@ -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;