mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 23:25:24 +02:00
FileInputStream.java (close): Check if the fd is valid.
* java/io/FileInputStream.java (close): Check if the fd is valid. * java/io/RandomAccessFile.java (close): Ditto. * java/net/PlainDatagramSocketImpl.java (close): Ditto. * java/net/PlainSocketImpl.java (close): Ditto. From-SVN: r38131
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -79,7 +79,8 @@ class PlainDatagramSocketImpl extends DatagramSocketImpl
|
||||
// we'll catch the IOException here.
|
||||
try
|
||||
{
|
||||
fd.close();
|
||||
if (fd.valid())
|
||||
fd.close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
|
||||
@@ -92,6 +92,7 @@ class PlainSocketImpl extends SocketImpl
|
||||
|
||||
protected void close () throws IOException
|
||||
{
|
||||
fd.close();
|
||||
if (fd.valid())
|
||||
fd.close();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user