Update of /cvsroot/monetdb/MonetDB/src/gdk
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv30895

Modified Files:
      Tag: MonetDB_1-20
        gdk_posix.mx 
Log Message:
[ 1852327 ] remap in src/modules/plain/Tests/bat.py fails on Win64

after some discussion on microsoft.public.win32.programmer.kernel
it appears that *not* passing FILE_SHARE_WRITE will make a read-only
open on a file fail if that file is also opened in write-mode. 

it perfectly explains why the second CreateFile fails (except for
the question why the problem does not exist in Windows32)

the other suggestion from the community was to keep the file handles
open as long as a mmap on the file is open, but doing so changes
the API and would be a hassle in MonetDB.

So let's hope this does it. I cannot test on windows64, so this is not tested.



Index: gdk_posix.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB/src/gdk/gdk_posix.mx,v
retrieving revision 1.143.2.7
retrieving revision 1.143.2.8
diff -u -d -r1.143.2.7 -r1.143.2.8
--- gdk_posix.mx        19 Dec 2007 12:56:52 -0000      1.143.2.7
+++ gdk_posix.mx        26 Dec 2007 23:41:48 -0000      1.143.2.8
@@ -1254,7 +1254,7 @@
 {
        void *ret = NULL;
        DWORD mode0 = FILE_READ_ATTRIBUTES | FILE_READ_DATA;
-       DWORD mode1 = FILE_SHARE_READ;
+       DWORD mode1 = FILE_SHARE_READ | FILE_SHARE_WRITE;
        DWORD mode2 = mode & MMAP_ADVISE;
        DWORD mode3 = PAGE_READONLY;
        int mode4 = FILE_MAP_READ;
@@ -1265,7 +1265,6 @@
        memset(hdl, 0, sizeof(MT_mmap_hdl));
        if (mode & MMAP_WRITE) {
                mode0 |= FILE_APPEND_DATA | FILE_WRITE_ATTRIBUTES | 
FILE_WRITE_DATA;
-               mode1 |= FILE_SHARE_WRITE;
        }
        if (mode2 == MMAP_RANDOM || mode2 == MMAP_DONTNEED) {
                mode2 = FILE_FLAG_RANDOM_ACCESS;


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to