This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: WIN-28: fix POSIX file descriptor numbering assumptions


Adam Megacz wrote:

>Sorry, sent this to java@ instead of java-patches@
>
>ok to commit?
>
>  - a
>
>2002-02-25  Adam Megacz  <adam@xwt.org>
>
>        * java/io/FileDescriptor.java: We now use getFD**().
>        * java/io/natFileDescriptorWin32.cc (getFDin, getFDout,
>        getFDerr): Added these.
>        * java/io/natFileDescriptorPosix.cc (getFDin, getFDout,
>        getFDerr): Added these.
>        * java/io/natFileDescriptorEcos.cc (getFDin, getFDout,
>        getFDerr): Added these.
>

How about putting the initialization of in/out/err into a native method 
and calling it from a static initializer, ie:

static
{
  initNative();
}

This will be slightly cleaner and more efficient, and the initNative 
might come in useful later.

Also, you should add a fixme in the win32 code about how wrong it is to 
store the file handle as an int!

Bryce.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]