From 38ccd3a23e51dfa06064e438619e7eef65564687 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Fri, 19 Dec 2008 10:15:35 -0500 Subject: [PATCH] Do vt ioctl on the right fd. --- egl-compositor.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/egl-compositor.c b/egl-compositor.c index 33081a3..3c8aeb6 100644 --- a/egl-compositor.c +++ b/egl-compositor.c @@ -1054,6 +1054,8 @@ static void on_enter_vt(int signal_number, void *data) int i, ret; int fd; + ioctl(ec->tty_fd, VT_RELDISP, VT_ACKACQ); + fd = ec->gem_fd; resources = drmModeGetResources(fd); if (!resources) { @@ -1110,7 +1112,6 @@ static void on_leave_vt(int signal_number, void *data) static void watch_for_vt_changes(struct egl_compositor *ec, struct wl_event_loop *loop) { - int fd; struct vt_mode mode = { 0 }; ec->tty_fd = open("/dev/tty0", O_RDWR | O_NOCTTY); @@ -1118,7 +1119,7 @@ static void watch_for_vt_changes(struct egl_compositor *ec, struct wl_event_loop mode.relsig = SIGUSR1; mode.acqsig = SIGUSR2; - if (!ioctl (fd, VT_SETMODE, &mode) < 0) { + if (!ioctl (ec->tty_fd, VT_SETMODE, &mode) < 0) { fprintf(stderr, "failed to take control of vt handling\n"); } -- 2.7.4