Commit 2941ddc4 by Casey Marshall Committed by Bryce McKinlay

FileLock.java (isValid): locks are valid if the channel is open.

2004-11-11  Casey Marshall  <csm@gnu.org>

	* gnu/java/nio/FileLock.java (isValid): locks are valid if the
	channel is open.
	* gnu/java/nio/channels/natFileChannelPosix.cc (lock): use
	'F_RDLCK' for shared locks, 'F_WRLCK' for exclusive locks.

From-SVN: r90538
parent 556f03c4
2004-11-11 Casey Marshall <csm@gnu.org>
* gnu/java/nio/FileLock.java (isValid): locks are valid if the
channel is open.
* gnu/java/nio/channels/natFileChannelPosix.cc (lock): use
'F_RDLCK' for shared locks, 'F_WRLCK' for exclusive locks.
2004-11-11 Robert Schuster <thebohemian@gmx.net> 2004-11-11 Robert Schuster <thebohemian@gmx.net>
Fixed regression: Fixed regression:
......
...@@ -72,7 +72,7 @@ public class FileLockImpl extends FileLock ...@@ -72,7 +72,7 @@ public class FileLockImpl extends FileLock
public boolean isValid () public boolean isValid ()
{ {
return !channel().isOpen(); return channel().isOpen();
} }
public synchronized void release () throws IOException public synchronized void release () throws IOException
......
...@@ -457,7 +457,7 @@ FileChannelImpl::lock ...@@ -457,7 +457,7 @@ FileChannelImpl::lock
{ {
struct flock lockdata; struct flock lockdata;
lockdata.l_type = shared ? F_WRLCK : F_RDLCK; lockdata.l_type = shared ? F_RDLCK : F_WRLCK;
lockdata.l_whence = SEEK_SET; lockdata.l_whence = SEEK_SET;
lockdata.l_start = pos; lockdata.l_start = pos;
lockdata.l_len = len; lockdata.l_len = len;
......
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