Revision 793cbfb5 qemu-char.c

b/qemu-char.c
570 570
    if (size == 0) {
571 571
        /* FD has been closed. Remove it from the active list.  */
572 572
        qemu_set_fd_handler2(s->fd_in, NULL, NULL, NULL, NULL);
573
        qemu_chr_event(chr, CHR_EVENT_CLOSED);
573 574
        return;
574 575
    }
575 576
    if (size > 0) {
......
602 603
    }
603 604

  
604 605
    qemu_free(s);
606
    qemu_chr_event(chr, CHR_EVENT_CLOSED);
605 607
}
606 608

  
607 609
/* open a character device to a unix fd */
......
690 692
    if (size == 0) {
691 693
        /* stdin has been closed. Remove it from the active list.  */
692 694
        qemu_set_fd_handler2(0, NULL, NULL, NULL, NULL);
695
        qemu_chr_event(chr, CHR_EVENT_CLOSED);
693 696
        return;
694 697
    }
695 698
    if (size > 0) {
......
943 946
    qemu_del_timer(s->timer);
944 947
    qemu_free_timer(s->timer);
945 948
    qemu_free(s);
949
    qemu_chr_event(chr, CHR_EVENT_CLOSED);
946 950
}
947 951

  
948 952
static CharDriverState *qemu_chr_open_pty(void)
......
1264 1268
    ioctl(fd, PPRELEASE);
1265 1269
    close(fd);
1266 1270
    qemu_free(drv);
1271
    qemu_chr_event(chr, CHR_EVENT_CLOSED);
1267 1272
}
1268 1273

  
1269 1274
static CharDriverState *qemu_chr_open_pp(const char *filename)
......
1390 1395
        qemu_del_polling_cb(win_chr_pipe_poll, chr);
1391 1396
    else
1392 1397
        qemu_del_polling_cb(win_chr_poll, chr);
1398

  
1399
    qemu_chr_event(chr, CHR_EVENT_CLOSED);
1393 1400
}
1394 1401

  
1395 1402
static int win_chr_init(CharDriverState *chr, const char *filename)
......
1779 1786
        closesocket(s->fd);
1780 1787
    }
1781 1788
    qemu_free(s);
1789
    qemu_chr_event(chr, CHR_EVENT_CLOSED);
1782 1790
}
1783 1791

  
1784 1792
static CharDriverState *qemu_chr_open_udp(const char *def)
......
1999 2007
        qemu_set_fd_handler(s->fd, NULL, NULL, NULL);
2000 2008
        closesocket(s->fd);
2001 2009
        s->fd = -1;
2010
        qemu_chr_event(chr, CHR_EVENT_CLOSED);
2002 2011
    } else if (size > 0) {
2003 2012
        if (s->do_telnetopt)
2004 2013
            tcp_chr_process_IAC_bytes(chr, s, buf, &size);
......
2095 2104
        closesocket(s->listen_fd);
2096 2105
    }
2097 2106
    qemu_free(s);
2107
    qemu_chr_event(chr, CHR_EVENT_CLOSED);
2098 2108
}
2099 2109

  
2100 2110
static CharDriverState *qemu_chr_open_tcp(const char *host_str,

Also available in: Unified diff