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).

Location:
trunk/openjdk/jdk/src/share/native/java/io
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/openjdk/jdk/src/share/native/java/io/FileInputStream.c

    r278 r373  
    7878    jlong end = jlong_zero;
    7979    FD fd = GET_FD(this, fis_fd);
    80     if (fd == -1) {
     80    if (!VALID_FD(fd)) {
    8181        JNU_ThrowIOException (env, "Stream Closed");
    8282        return 0;
     
    9494    jlong ret;
    9595    FD fd = GET_FD(this, fis_fd);
    96     if (fd == -1) {
     96    if (!VALID_FD(fd)) {
    9797        JNU_ThrowIOException (env, "Stream Closed");
    9898        return 0;
  • trunk/openjdk/jdk/src/share/native/java/io/RandomAccessFile.c

    r278 r373  
    9191    jlong ret;
    9292
    93     fd = GET_FD(this, raf_fd);
    94     if (fd == -1) {
     93    ASSIGN_FD(fd, this, raf_fd);
     94    if (!VALID_FD(fd)) {
    9595        JNU_ThrowIOException(env, "Stream Closed");
    9696        return -1;
     
    108108    jlong end = jlong_zero;
    109109
    110     fd = GET_FD(this, raf_fd);
    111     if (fd == -1) {
     110    ASSIGN_FD(fd, this, raf_fd);
     111    if (!VALID_FD(fd)) {
    112112        JNU_ThrowIOException(env, "Stream Closed");
    113113        return -1;
     
    129129    FD fd;
    130130
    131     fd = GET_FD(this, raf_fd);
    132     if (fd == -1) {
     131    ASSIGN_FD(fd, this, raf_fd);
     132    if (!VALID_FD(fd)) {
    133133        JNU_ThrowIOException(env, "Stream Closed");
    134134        return;
     
    148148    jlong cur;
    149149
    150     fd = GET_FD(this, raf_fd);
    151     if (fd == -1) {
     150    ASSIGN_FD(fd, this, raf_fd);
     151    if (!VALID_FD(fd)) {
    152152        JNU_ThrowIOException(env, "Stream Closed");
    153153        return;
  • trunk/openjdk/jdk/src/share/native/java/io/io_util.c

    r278 r373  
    4141    char ret;
    4242    FD fd = GET_FD(this, fid);
    43     if (fd == -1) {
     43    if (!VALID_FD(fd)) {
    4444        JNU_ThrowIOException(env, "Stream Closed");
    4545        return -1;
     
    104104    }
    105105
    106     fd = GET_FD(this, fid);
    107     if (fd == -1) {
     106    ASSIGN_FD(fd, this, fid);
     107    if (!VALID_FD(fd)) {
    108108        JNU_ThrowIOException(env, "Stream Closed");
    109109        nread = -1;
     
    133133    jint n;
    134134    FD fd = GET_FD(this, fid);
    135     if (fd == -1) {
     135    if (!VALID_FD(fd)) {
    136136        JNU_ThrowIOException(env, "Stream Closed");
    137137        return;
     
    181181        off = 0;
    182182        while (len > 0) {
    183             fd = GET_FD(this, fid);
    184             if (fd == -1) {
     183            ASSIGN_FD(fd, this, fid);
     184            if (!VALID_FD(fd)) {
    185185                JNU_ThrowIOException(env, "Stream Closed");
    186186                break;
Note: See TracChangeset for help on using the changeset viewer.