Revision 4266a134 qemu-char.c

b/qemu-char.c
1173 1173
    return 0;
1174 1174
}
1175 1175

  
1176
static void qemu_chr_close_tty(CharDriverState *chr)
1177
{
1178
    FDCharDriver *s = chr->opaque;
1179
    int fd = -1;
1180

  
1181
    if (s) {
1182
        fd = s->fd_in;
1183
    }
1184

  
1185
    fd_chr_close(chr);
1186

  
1187
    if (fd >= 0) {
1188
        close(fd);
1189
    }
1190
}
1191

  
1176 1192
static CharDriverState *qemu_chr_open_tty(QemuOpts *opts)
1177 1193
{
1178 1194
    const char *filename = qemu_opt_get(opts, "path");
......
1190 1206
        return NULL;
1191 1207
    }
1192 1208
    chr->chr_ioctl = tty_serial_ioctl;
1209
    chr->chr_close = qemu_chr_close_tty;
1193 1210
    return chr;
1194 1211
}
1195 1212
#else  /* ! __linux__ && ! __sun__ */

Also available in: Unified diff