WIN-35: disable Win32 file locking [request 3.1.1 branch approval]
Adam Megacz
gcj@lists.megacz.com
Wed Jun 5 15:02:00 GMT 2002
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)
{
More information about the Java
mailing list