patch to make Win32 file locking work like POSIX -- objections?

Jon Beniston jbeniston@siroyan.com
Fri Mar 15 09:37:00 GMT 2002


>
> 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 that was me, then it was definitely unconscious, much like the rest of my
coding...

Cheers,
JonB

>
> 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
>




**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************



More information about the Java-patches mailing list