Commit 42ad53ac authored by Ramon Nou's avatar Ramon Nou
Browse files

change fdopen implementation to get a real FILE

parent 3f002b02
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2616,7 +2616,7 @@ fdopen(int fd, const char* mode) {
    FILE* ret;
    if(CTX->interception_enabled()) {
        if(CTX->file_map()->exist(fd)) {
            ret = (FILE*) malloc(sizeof(FILE));
            /*ret = (FILE*) malloc(sizeof(FILE));
            ret->_flags = 0;
            ret->_IO_read_ptr = 0;
            ret->_IO_read_end = 0;
@@ -2632,6 +2632,9 @@ fdopen(int fd, const char* mode) {
            ret->_fileno = fd;
            ret->_lock = 0;
            ret->_offset = 0;
            */
            ret = dlsym_fopen("/dev/null", mode);
            ret->_fileno = fd;
            return ret;
        }
    }