diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-12-26 00:24:01 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-12-26 00:24:01 +0000 |
commit | c51f00ea19cebb48e5f918eede4a10ac226d0822 (patch) | |
tree | 8bd48af9f8b2ae3ec0d24d598d43ca4268c57848 /libjava/java/io/FileDescriptor.java | |
parent | 465f28ca1902ad1c81ed6af6492453e226ecb73c (diff) | |
download | ppe42-gcc-c51f00ea19cebb48e5f918eede4a10ac226d0822.tar.gz ppe42-gcc-c51f00ea19cebb48e5f918eede4a10ac226d0822.zip |
2000-12-24 Jeff Sturm <jeff.sturm@commerceone.com>
* java/io/FileDescriptor.java: Initialize fd to -1.
Remove default constructor.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38485 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/io/FileDescriptor.java')
-rw-r--r-- | libjava/java/io/FileDescriptor.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/libjava/java/io/FileDescriptor.java b/libjava/java/io/FileDescriptor.java index 51c6fd6c5b1..493f14cf280 100644 --- a/libjava/java/io/FileDescriptor.java +++ b/libjava/java/io/FileDescriptor.java @@ -49,11 +49,6 @@ public final class FileDescriptor 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) @@ -84,6 +79,10 @@ public final class FileDescriptor fd = desc; } - // System's notion of file descriptor. - private int fd; + // System's notion of file descriptor. It might seem redundant to + // initialize this given that it is reassigned in the constructors. + // However, this is necessary because if open() throws an exception + // we want to make sure this has the value -1. This is the most + // efficient way to accomplish that. + private int fd = -1; } |