summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans De Goede <hdegoede@redhat.com>2016-07-07 10:55:04 +0200
committerAdam Jackson <ajax@redhat.com>2016-07-08 13:43:25 -0400
commit033888e7766d226a179357d970223428c19c4b53 (patch)
treef941b1a646dd9e1d2f95483b2bca555b3c55c398
parentce24f3aa5815e03c2d501d1504f6c0162b219801 (diff)
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 <chad.versace@linux.intel.com> Suggested-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Chad Versace <chad.versace@intel.com>
-rw-r--r--hw/xfree86/os-support/linux/lnx_init.c10
1 files changed, 1 insertions, 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;