static int pty_chr_write(CharDriverState *chr, const uint8_t *buf, int len)

{

    PtyCharDriver *s = chr->opaque;



    if (!s->connected) {

        /* guest sends data, check for (re-)connect */

        pty_chr_update_read_handler(chr);

        return 0;

    }

    return io_channel_send(s->fd, buf, len);

}

static int pty_chr_write(CharDriverState *chr, const uint8_t *buf, int len)

{

    PtyCharDriver *s = chr->opaque;



    if (!s->connected) {

        

        pty_chr_update_read_handler(chr);

        return 0;

    }

    return io_channel_send(s->fd, buf, len);

}

static int FUNC_0(CharDriverState *VAR_0, const uint8_t *VAR_1, int VAR_2)

{

    PtyCharDriver *s = VAR_0->opaque;



    if (!s->connected) {

        

        pty_chr_update_read_handler(VAR_0);

        return 0;

    }

    return io_channel_send(s->fd, VAR_1, VAR_2);

}

static int FUNC_0(CharDriverState *VAR_0, const uint8_t *VAR_1, int VAR_2)
{ PtyCharDriver *s = VAR_0->opaque; if (!s->connected) { pty_chr_update_read_handler(VAR_0); return 0; } return io_channel_send(s->fd, VAR_1, VAR_2); }