WIN-28: fix POSIX file descriptor numbering assumptions

Bryce McKinlay bryce@waitaki.otago.ac.nz
Fri Mar 1 20:27:00 GMT 2002


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.




More information about the Java-patches mailing list