summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2005-09-11 19:29:24 +0000
committerMark Wielaard <mark@klomp.org>2005-09-11 19:29:24 +0000
commit99c81aa3662702a4b6488363b0a5cf4c30b89d46 (patch)
tree0b434241d98d90f7036dbca84736ef17d505321f
parentcc1839a19b312b428bde1fdb22f4d84f92baba18 (diff)
downloadclasspath-99c81aa3662702a4b6488363b0a5cf4c30b89d46.tar.gz
* gnu/java/nio/channels/FileChannelImpl.java (finalize): Check whether
fd != -1 before calling close().
-rw-r--r--ChangeLog5
-rw-r--r--gnu/java/nio/channels/FileChannelImpl.java3
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 7050e9a18..76802ea8c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-09-11 Mark Wielaard <mark@klomp.org>
+
+ * gnu/java/nio/channels/FileChannelImpl.java (finalize): Check whether
+ fd != -1 before calling close().
+
2005-09-10 David Gilbert <david.gilbert@object-refinery.com>
* javax/swing/plaf/metal/MetalBorders.java
diff --git a/gnu/java/nio/channels/FileChannelImpl.java b/gnu/java/nio/channels/FileChannelImpl.java
index 0ee5d3fc2..466f3dd55 100644
--- a/gnu/java/nio/channels/FileChannelImpl.java
+++ b/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