aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath/gnu/java/nio/channels/FileChannelImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/gnu/java/nio/channels/FileChannelImpl.java')
-rw-r--r--libjava/classpath/gnu/java/nio/channels/FileChannelImpl.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/libjava/classpath/gnu/java/nio/channels/FileChannelImpl.java b/libjava/classpath/gnu/java/nio/channels/FileChannelImpl.java
index 0ee5d3fc287..466f3dd5587 100644
--- a/libjava/classpath/gnu/java/nio/channels/FileChannelImpl.java
+++ b/libjava/classpath/gnu/java/nio/channels/FileChannelImpl.java
@@ -175,7 +175,8 @@ public final class FileChannelImpl extends FileChannel
*/
protected void finalize() throws IOException
{
- this.close();
+ if (fd != -1)
+ close();
}
public int read (ByteBuffer dst) throws IOException