This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
WIN-35: disable Win32 file locking [request 3.1.1 branch approval]
- From: Adam Megacz <gcj at lists dot megacz dot com>
- To: java at gcc dot gnu dot org, mark at codesourcery dot com
- Date: 05 Jun 2002 14:59:26 -0700
- Subject: WIN-35: disable Win32 file locking [request 3.1.1 branch approval]
- Organization: Myself
Ok branch and trunk? This only touches Win32-specific code.
- a
2002-06-05 Adam Megacz <adam@xwt.org>
* java/io/natFileDescriptorWin32.cc (open): Disable Win32 file
locking, just like the Sun JVM does.
Index: natFileDescriptorWin32.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/natFileDescriptorWin32.cc,v
retrieving revision 1.5.2.2
diff -u -r1.5.2.2 natFileDescriptorWin32.cc
--- natFileDescriptorWin32.cc 10 Mar 2002 03:34:59 -0000 1.5.2.2
+++ natFileDescriptorWin32.cc 5 Jun 2002 21:58:49 -0000
@@ -82,7 +82,6 @@
HANDLE handle = NULL;
DWORD access = 0;
- DWORD share = FILE_SHARE_READ;
DWORD create = OPEN_EXISTING;
char buf[MAX_PATH] = "";
@@ -94,7 +93,6 @@
if ((jflags & READ) && (jflags & WRITE))
{
access = GENERIC_READ | GENERIC_WRITE;
- share = 0;
if (jflags & APPEND)
create = OPEN_ALWAYS;
else
@@ -105,14 +103,13 @@
else
{
access = GENERIC_WRITE;
- share = 0;
if (jflags & APPEND)
create = OPEN_ALWAYS;
else
create = CREATE_ALWAYS;
}
- handle = CreateFile(buf, access, share, NULL, create, 0, NULL);
+ handle = CreateFile(buf, access, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, create, 0, NULL);
if (handle == INVALID_HANDLE_VALUE)
{