Revision d7234f4d qemu-char.c
b/qemu-char.c | ||
---|---|---|
713 | 713 |
fcntl(0, F_SETFL, old_fd0_flags); |
714 | 714 |
} |
715 | 715 |
|
716 |
static void term_exit_notifier(Notifier *notifier) |
|
717 |
{ |
|
718 |
term_exit(); |
|
719 |
} |
|
720 |
|
|
716 | 721 |
static void term_init(QemuOpts *opts) |
717 | 722 |
{ |
718 | 723 |
struct termios tty; |
724 |
static Notifier exit_notifier = { .notify = term_exit_notifier }; |
|
719 | 725 |
|
720 | 726 |
tcgetattr (0, &tty); |
721 | 727 |
oldtty = tty; |
... | ... | |
735 | 741 |
|
736 | 742 |
tcsetattr (0, TCSANOW, &tty); |
737 | 743 |
|
738 |
if (!term_atexit_done++) |
|
739 |
atexit(term_exit); |
|
744 |
if (!term_atexit_done++) { |
|
745 |
exit_notifier_add(&exit_notifier); |
|
746 |
} |
|
740 | 747 |
|
741 | 748 |
fcntl(0, F_SETFL, O_NONBLOCK); |
742 | 749 |
} |
Also available in: Unified diff