VirtualBox

Changeset 2647 in kBuild for trunk/src


Ignore:
Timestamp:
Sep 9, 2012 3:21:35 AM (12 years ago)
Author:
bird
Message:

shfile.c: Fixed bug in shfile_movefd that caused sever file descriptor leakage when using redirection.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/shfile.c

    r2553 r2647  
    12011201
    12021202#else
    1203     return dup2(fdfrom, fdto);
     1203    int fdnew = dup2(fdfrom, fdto);
     1204    if (fdnew >= 0)
     1205        close(fdfrom);
     1206    return fdnew;
    12041207#endif
    12051208}
     
    15031506        case F_GETFL: TRACE2((NULL, "shfile_fcntl(%d,F_GETFL,ignored=%d) -> %d [%d]\n", fd, arg, rc, errno));  break;
    15041507        case F_SETFL: TRACE2((NULL, "shfile_fcntl(%d,F_SETFL,newflags=%#x) -> %d [%d]\n", fd, arg, rc, errno)); break;
    1505         case F_DUPFD: TRACE2((NULL, "shfile_fcntl(%d,F_DUPFS,minfd=%d) -> %d [%d]\n", fd, arg, rc, errno)); break;
     1508        case F_DUPFD: TRACE2((NULL, "shfile_fcntl(%d,F_DUPFD,minfd=%d) -> %d [%d]\n", fd, arg, rc, errno)); break;
    15061509        default:  TRACE2((NULL, "shfile_fcntl(%d,%d,%d) -> %d [%d]\n", fd, cmd, arg, rc, errno)); break;
    15071510    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette