This is the mail archive of the
java-patches@sources.redhat.com
mailing list for the Java project.
Patch: java/io/FileDescriptor.java
- To: java-patches at sources dot redhat dot com
- Subject: Patch: java/io/FileDescriptor.java
- From: jeff dot sturm at appnet dot com
- Date: Sun, 24 Dec 2000 22:56:18 -0500 (EST)
This fixes a bug in which uninitialized FileDescriptor objects
accidentally close stdin when finalized. (This occurs when attempting to
open a nonexistent file, for instance.)
2000-12-24 Jeff Sturm <jeff.sturm@commerceone.com>
* java/io/FileDescriptor.java: Initialize fd to -1.
Remove default constructor.
Index: java/io/FileDescriptor.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/FileDescriptor.java,v
retrieving revision 1.5
diff -u -r1.5 FileDescriptor.java
--- FileDescriptor.java 2000/03/07 19:55:26 1.5
+++ FileDescriptor.java 2000/12/25 03:52:44
@@ -49,11 +49,6 @@
fd = open (path, mode);
}
- public FileDescriptor ()
- {
- fd = -1;
- }
-
native int open (String path, int mode) throws FileNotFoundException;
native void write (int b) throws IOException;
native void write (byte[] b, int offset, int len)
@@ -85,5 +80,5 @@
}
// System's notion of file descriptor.
- private int fd;
+ private int fd = -1;
}