Commit 28038fe1 by Adam Megacz Committed by Adam Megacz

natFileDescriptorWin32.cc (open): Disable Win32 file locking, just like the Sun JVM does.

2002-06-06  Adam Megacz <adam@xwt.org>

        * java/io/natFileDescriptorWin32.cc (open): Disable Win32 file
        locking, just like the Sun JVM does.

From-SVN: r54322
parent 8a5d66c4
2002-06-06 Adam Megacz <adam@xwt.org>
* java/io/natFileDescriptorWin32.cc (open): Disable Win32 file
locking, just like the Sun JVM does.
2002-06-05 H.J. Lu (hjl@gnu.org) 2002-06-05 H.J. Lu (hjl@gnu.org)
* Makefile.am (libgcj_convenience.la): Revert the last change. * Makefile.am (libgcj_convenience.la): Revert the last change.
......
...@@ -85,7 +85,6 @@ java::io::FileDescriptor::open (jstring path, jint jflags) { ...@@ -85,7 +85,6 @@ java::io::FileDescriptor::open (jstring path, jint jflags) {
HANDLE handle = NULL; HANDLE handle = NULL;
DWORD access = 0; DWORD access = 0;
DWORD share = FILE_SHARE_READ;
DWORD create = OPEN_EXISTING; DWORD create = OPEN_EXISTING;
char buf[MAX_PATH] = ""; char buf[MAX_PATH] = "";
...@@ -97,7 +96,6 @@ java::io::FileDescriptor::open (jstring path, jint jflags) { ...@@ -97,7 +96,6 @@ java::io::FileDescriptor::open (jstring path, jint jflags) {
if ((jflags & READ) && (jflags & WRITE)) if ((jflags & READ) && (jflags & WRITE))
{ {
access = GENERIC_READ | GENERIC_WRITE; access = GENERIC_READ | GENERIC_WRITE;
share = 0;
if (jflags & APPEND) if (jflags & APPEND)
create = OPEN_ALWAYS; create = OPEN_ALWAYS;
else else
...@@ -108,14 +106,13 @@ java::io::FileDescriptor::open (jstring path, jint jflags) { ...@@ -108,14 +106,13 @@ java::io::FileDescriptor::open (jstring path, jint jflags) {
else else
{ {
access = GENERIC_WRITE; access = GENERIC_WRITE;
share = 0;
if (jflags & APPEND) if (jflags & APPEND)
create = OPEN_ALWAYS; create = OPEN_ALWAYS;
else else
create = CREATE_ALWAYS; 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) if (handle == INVALID_HANDLE_VALUE)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment