Ignore:
Timestamp:
May 31, 2012, 5:49:53 PM (13 years ago)
Author:
dmik
Message:

icedtea-web: Make java.io.FileDescriptor work with LIBC file descriptors.

On Windows, this class carries both the windows handle and the libc file
descriptor but only handles were used so far. Now, if the handle is not set,
the descriptor will be used (with a relevant LIBC call).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openjdk/jdk/src/solaris/native/java/io/io_util_md.h

    r278 r373  
    4848        -1 : (*env)->GetIntField(env, (*env)->GetObjectField(env, (this), (fid)), IO_fd_fdID)
    4949
     50#define ASSIGN_FD(fd, this, fid) \
     51    do { \
     52        fd = (*env)->GetObjectField(env, (this), (fid)) == NULL ? \
     53            -1 : (*env)->GetIntField(env, (*env)->GetObjectField(env, (this), (fid)), IO_fd_fdID); \
     54    } while(0)
     55
     56#define VALID_FD(fd) (fd != -1)
     57
    5058/*
    5159 * Macros to set/get fd when inside java.io.FileDescriptor
     
    6674 * On Solaris, the handle field is unused
    6775 */
    68 #define SET_HANDLE(fd) return (jlong)-1
     76#define RETURN_HANDLE(fd) return (jlong)-1
    6977
    7078/*
Note: See TracChangeset for help on using the changeset viewer.