aboutsummaryrefslogtreecommitdiff
path: root/ui/gtk.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui/gtk.c')
-rw-r--r--ui/gtk.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index e314dba343..50a6993627 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1160,8 +1160,7 @@ static GSList *gd_vc_init(GtkDisplayState *s, VirtualConsole *vc, int index, GSL
GIOChannel *chan;
GtkWidget *scrolled_window;
GtkAdjustment *vadjustment;
- int master_fd, slave_fd, ret;
- struct termios tty;
+ int master_fd, slave_fd;
snprintf(buffer, sizeof(buffer), "vc%d", index);
snprintf(path, sizeof(path), "<QEMU>/View/VC%d", index);
@@ -1181,13 +1180,8 @@ static GSList *gd_vc_init(GtkDisplayState *s, VirtualConsole *vc, int index, GSL
vc->terminal = vte_terminal_new();
- ret = openpty(&master_fd, &slave_fd, NULL, NULL, NULL);
- g_assert(ret != -1);
-
- /* Set raw attributes on the pty. */
- tcgetattr(slave_fd, &tty);
- cfmakeraw(&tty);
- tcsetattr(slave_fd, TCSAFLUSH, &tty);
+ master_fd = qemu_openpty_raw(&slave_fd, NULL);
+ g_assert(master_fd != -1);
#if VTE_CHECK_VERSION(0, 26, 0)
pty = vte_pty_new_foreign(master_fd, NULL);