]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
natFileDescriptorWin32.cc (open): Disable Win32 file locking, just like the Sun JVM...
authorAdam Megacz <adam@xwt.org>
Thu, 6 Jun 2002 20:06:03 +0000 (20:06 +0000)
committerAdam Megacz <megacz@gcc.gnu.org>
Thu, 6 Jun 2002 20:06:03 +0000 (20:06 +0000)
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: r54320

libjava/ChangeLog
libjava/java/io/natFileDescriptorWin32.cc

index 26840d3bb6a6f3a12622cb6f3cb245b48411c9ec..d4202a2763e9fcf923c2b61083322012fda25d2b 100644 (file)
@@ -1,3 +1,8 @@
+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-03  Mark Mitchell  <mark@codesourcery.com>
        
        2002-05-23  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
index 286598fb1a24dc826a08879ed83e055d6127aa96..8c659a4993677fbe87e87f4a04bde9634f1f08bf 100644 (file)
@@ -82,7 +82,6 @@ java::io::FileDescriptor::open (jstring path, jint jflags) {
 
   HANDLE handle = NULL;
   DWORD access = 0;
-  DWORD share = FILE_SHARE_READ;
   DWORD create = OPEN_EXISTING;
   char buf[MAX_PATH] = "";
 
@@ -94,7 +93,6 @@ java::io::FileDescriptor::open (jstring path, jint jflags) {
   if ((jflags & READ) && (jflags & WRITE))
     {
       access = GENERIC_READ | GENERIC_WRITE;
-      share = 0;
       if (jflags & APPEND)
        create = OPEN_ALWAYS;
       else
@@ -105,14 +103,13 @@ java::io::FileDescriptor::open (jstring path, jint jflags) {
   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)
     {