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

Modified Files:
        gdk_posix.mx 
Log Message:
propagated changes of Tuesday Dec 18 2007
from the MonetDB_1-20 branch to the development trunk

[mainly to ensure they will (also) be tested on Windows tonight]


Index: gdk_posix.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB/src/gdk/gdk_posix.mx,v
retrieving revision 1.147
retrieving revision 1.148
diff -u -d -r1.147 -r1.148
--- gdk_posix.mx        11 Dec 2007 12:49:46 -0000      1.147
+++ gdk_posix.mx        18 Dec 2007 20:55:53 -0000      1.148
@@ -1253,7 +1253,7 @@
 MT_mmap_open(MT_mmap_hdl *hdl, char *path, int mode, off_t off, size_t len, 
size_t nremaps)
 {
        void *ret = NULL;
-       int mode0 = GENERIC_READ;
+       int mode0 = FILE_READ_ATTRIBUTES | FILE_READ_DATA;
        int mode1 = FILE_SHARE_READ;
        int mode2 = mode & MMAP_ADVISE;
        int mode3 = PAGE_READONLY;
@@ -1264,7 +1264,7 @@
 
        memset(hdl, 0, sizeof(MT_mmap_hdl));
        if (mode & MMAP_WRITE) {
-               mode0 |= GENERIC_WRITE;
+               mode0 |= FILE_APPEND_DATA | FILE_WRITE_ATTRIBUTES | 
FILE_WRITE_DATA;
                mode1 |= FILE_SHARE_WRITE;
        }
        if (mode2 == MMAP_RANDOM || mode2 == MMAP_DONTNEED) {
@@ -1744,7 +1744,13 @@
 win_unlink(const char *pathname)
 {
        int ret = _unlink(pathname);
-
+       if (ret < 0) {
+               /* Vista is paranoid: we cannot delete read-only files owned
+                * by ourselves. Vista somehow also sets these files to 
read-only.
+                */
+               (void) SetFileAttributes(path, FILE_ATTRIBUTE_NORMAL);
+               ret = _unlink(pathname);
+       }
        if (ret < 0) {
                /* it could be the <expletive deleted> indexing
                 * service which prevents us from doing what we have a


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to