This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
patch to make Win32 file locking work like POSIX -- objections?
- From: Adam Megacz <patches at lists dot megacz dot com>
- To: java-patches at gcc dot gnu dot org
- Date: 14 Mar 2002 18:36:28 -0800
- Subject: patch to make Win32 file locking work like POSIX -- objections?
- Organization: Myself
The following patch disables Win32's automatic file locking, making it
work the way POSIX file locking works ("off by default").
Does anybody object to this? The original author of
natFileDescriptorWin32 had file locking on -- I was wondering if that
was a conscious choice or just something that hadn't been dealt with
yet.
If there aren't any objections, I'll commit this.
- a
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 2002/03/10 03:34:59 1.5.2.2
+++ natFileDescriptorWin32.cc 2002/03/15 02:39:07
@@ -82,7 +82,7 @@
HANDLE handle = NULL;
DWORD access = 0;
- DWORD share = FILE_SHARE_READ;
+ DWORD share = FILE_SHARE_READ | FILE_SHARE_WRITE;
DWORD create = OPEN_EXISTING;
char buf[MAX_PATH] = "";
@@ -94,7 +94,6 @@
if ((jflags & READ) && (jflags & WRITE))
{
access = GENERIC_READ | GENERIC_WRITE;
- share = 0;
if (jflags & APPEND)
create = OPEN_ALWAYS;
else
@@ -105,7 +104,6 @@
else
{
access = GENERIC_WRITE;
- share = 0;
if (jflags & APPEND)
create = OPEN_ALWAYS;
else