From e4d5de5688633f1cffbedea8670f71e5427ec8a0 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 26 Sep 2003 13:28:17 +0000 Subject: [PATCH] Mapped MODE_SAFE to read/write file access. --- src/mm_io.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mm_io.cpp b/src/mm_io.cpp index 3ad546b28..4007ffb41 100644 --- a/src/mm_io.cpp +++ b/src/mm_io.cpp @@ -49,6 +49,9 @@ mm_io_c::mm_io_c(const char *path, const open_mode mode) { case MODE_CREATE: cmode = "wb+"; break; + case MODE_SAFE: + cmode = "r+b"; + break; default: throw 0; } @@ -120,7 +123,7 @@ mm_io_c::mm_io_c(const char *path, const open_mode mode) { switch (mode) { case MODE_READ: - access_mode = GENERIC_READ | GENERIC_WRITE; + access_mode = GENERIC_READ; share_mode = FILE_SHARE_READ | FILE_SHARE_WRITE; disposition = OPEN_EXISTING; break;