aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/io
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/io')
-rw-r--r--libjava/java/io/FileInputStream.java7
-rw-r--r--libjava/java/io/RandomAccessFile.java3
2 files changed, 4 insertions, 6 deletions
diff --git a/libjava/java/io/FileInputStream.java b/libjava/java/io/FileInputStream.java
index e5071e4..67d4842 100644
--- a/libjava/java/io/FileInputStream.java
+++ b/libjava/java/io/FileInputStream.java
@@ -51,11 +51,8 @@ public class FileInputStream extends InputStream
public void close() throws IOException
{
- if (fd == null)
- return;
-
- fd.close();
- fd = null;
+ if (fd.valid())
+ fd.close();
}
protected void finalize() throws IOException
diff --git a/libjava/java/io/RandomAccessFile.java b/libjava/java/io/RandomAccessFile.java
index d054afc..9a0bf80 100644
--- a/libjava/java/io/RandomAccessFile.java
+++ b/libjava/java/io/RandomAccessFile.java
@@ -24,7 +24,8 @@ public class RandomAccessFile implements DataOutput, DataInput
{
public void close () throws IOException
{
- fd.close();
+ if (fd.valid())
+ fd.close();
}
public final FileDescriptor getFD () throws IOException