Revision 39099991 qemu-char.c

b/qemu-char.c
3129 3129

  
3130 3130
static CharDriverState *qmp_chardev_open_port(ChardevPort *port, Error **errp)
3131 3131
{
3132
    int flags, fd;
3133

  
3134 3132
    switch (port->type) {
3135 3133
#ifdef HAVE_CHARDEV_TTY
3136 3134
    case CHARDEV_PORT_KIND_SERIAL:
3135
    {
3136
        int flags, fd;
3137 3137
        flags = O_RDWR;
3138 3138
        fd = qmp_chardev_open_file_source(port->device, flags, errp);
3139 3139
        if (error_is_set(errp)) {
......
3141 3141
        }
3142 3142
        socket_set_nonblock(fd);
3143 3143
        return qemu_chr_open_tty_fd(fd);
3144
    }
3144 3145
#endif
3145 3146
#ifdef HAVE_CHARDEV_PARPORT
3146 3147
    case CHARDEV_PORT_KIND_PARALLEL:
3148
    {
3149
        int flags, fd;
3147 3150
        flags = O_RDWR;
3148 3151
        fd = qmp_chardev_open_file_source(port->device, flags, errp);
3149 3152
        if (error_is_set(errp)) {
3150 3153
            return NULL;
3151 3154
        }
3152 3155
        return qemu_chr_open_pp_fd(fd);
3156
    }
3153 3157
#endif
3154 3158
    default:
3155 3159
        error_setg(errp, "unknown chardev port (%d)", port->type);

Also available in: Unified diff