From 033888e7766d226a179357d970223428c19c4b53 Mon Sep 17 00:00:00 2001 From: Hans De Goede Date: Thu, 7 Jul 2016 10:55:04 +0200 Subject: [PATCH] linux: Do not try to open /dev/vc/0, fix error msg when /dev/tty0 open fails /dev/vc/0 is a devfs thing which is long dead, so stop trying to open /dev/vc/0, besides being a (small) code cleanup this will also fix the "parse_vt_settings: Cannot open /dev/tty0 (%s)\n" error message to display the actual error, rather then the -ENOENT from also trying /dev/vc/0. BugLink: https://patchwork.freedesktop.org/patch/8768/ Reported-by: Chad Versace Suggested-by: Julien Cristau Signed-off-by: Hans de Goede Reviewed-by: Julien Cristau Reviewed-by: Chad Versace --- hw/xfree86/os-support/linux/lnx_init.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c index d3a53ea83..dbf497ca2 100644 --- a/hw/xfree86/os-support/linux/lnx_init.c +++ b/hw/xfree86/os-support/linux/lnx_init.c @@ -93,7 +93,6 @@ linux_parse_vt_settings(int may_fail) struct vt_stat vts; struct stat st; MessageType from = X_PROBED; - const char *tty0[] = { "/dev/tty0", "/dev/vc/0", NULL }; /* Only do this once */ static int vt_settings_parsed = 0; @@ -108,14 +107,7 @@ linux_parse_vt_settings(int may_fail) from = X_CMDLINE; } else { - - i = 0; - while (tty0[i] != NULL) { - if ((fd = open(tty0[i], O_WRONLY, 0)) >= 0) - break; - i++; - } - + fd = open("/dev/tty0", O_WRONLY, 0); if (fd < 0) { if (may_fail) return 0;