mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-18 12:41:25 +08:00
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
This commit is contained in:
parent
556f03c4f0
commit
2941ddc40c
@ -1,3 +1,10 @@
|
||||
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>
|
||||
|
||||
Fixed regression:
|
||||
|
@ -72,7 +72,7 @@ public class FileLockImpl extends FileLock
|
||||
|
||||
public boolean isValid ()
|
||||
{
|
||||
return !channel().isOpen();
|
||||
return channel().isOpen();
|
||||
}
|
||||
|
||||
public synchronized void release () throws IOException
|
||||
|
@ -457,7 +457,7 @@ FileChannelImpl::lock
|
||||
{
|
||||
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_start = pos;
|
||||
lockdata.l_len = len;
|
||||
|
Loading…
x
Reference in New Issue
Block a user