static void pty_chr_close(struct CharDriverState *chr)

{

    PtyCharDriver *s = chr->opaque;

    int fd;



    remove_fd_in_watch(chr);

    fd = g_io_channel_unix_get_fd(s->fd);

    g_io_channel_unref(s->fd);

    close(fd);

    if (s->timer_tag) {

        g_source_remove(s->timer_tag);

        s->timer_tag = 0;

    }

    g_free(s);

    qemu_chr_be_event(chr, CHR_EVENT_CLOSED);

}

static void pty_chr_close(struct CharDriverState *chr)

{

    PtyCharDriver *s = chr->opaque;

    int fd;



    remove_fd_in_watch(chr);

    fd = g_io_channel_unix_get_fd(s->fd);

    g_io_channel_unref(s->fd);

    close(fd);

    if (s->timer_tag) {

        g_source_remove(s->timer_tag);

        s->timer_tag = 0;

    }

    g_free(s);

    qemu_chr_be_event(chr, CHR_EVENT_CLOSED);

}

    remove_fd_in_watch(chr);
static void FUNC_0(struct CharDriverState *VAR_0)

{

    PtyCharDriver *s = VAR_0->opaque;

    int VAR_1;



    remove_fd_in_watch(VAR_0);

    VAR_1 = g_io_channel_unix_get_fd(s->VAR_1);

    g_io_channel_unref(s->VAR_1);

    close(VAR_1);

    if (s->timer_tag) {

        g_source_remove(s->timer_tag);

        s->timer_tag = 0;

    }

    g_free(s);

    qemu_chr_be_event(VAR_0, CHR_EVENT_CLOSED);

}

static void FUNC_0(struct CharDriverState *VAR_0)
{ PtyCharDriver *s = VAR_0->opaque; int VAR_1; remove_fd_in_watch(VAR_0); VAR_1 = g_io_channel_unix_get_fd(s->VAR_1); g_io_channel_unref(s->VAR_1); close(VAR_1); if (s->timer_tag) { g_source_remove(s->timer_tag); s->timer_tag = 0; } g_free(s); qemu_chr_be_event(VAR_0, CHR_EVENT_CLOSED); }