# --- T2-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # T2 SDE: package/.../xorg-server/kdrive-tty.patch # Copyright (C) 2007 The T2 SDE Project # # More information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # --- T2-COPYRIGHT-NOTE-END --- --- xorg-server-1.1.99.903/hw/kdrive/linux/linux.c.orig 2007-01-14 22:12:47.272384842 +0100 +++ xorg-server-1.1.99.903/hw/kdrive/linux/linux.c 2007-01-14 22:22:19.709006146 +0100 @@ -82,10 +82,11 @@ vtno = kdVirtualTerminal; else { - if ((fd = open("/dev/tty0",O_WRONLY,0)) < 0) + if ((fd = open("/dev/tty0",O_WRONLY,0)) < 0 && + (fd = open("/dev/vc/0",O_WRONLY,0)) < 0) { FatalError( - "LinuxInit: Cannot open /dev/tty0 (%s)\n", + "LinuxInit: Cannot open /dev/{tty,vs/}0 (%s)\n", strerror(errno)); } if ((ioctl(fd, VT_OPENQRY, &vtno) < 0) || @@ -97,11 +98,14 @@ close(fd); sprintf(vtname,"/dev/tty%d",vtno); /* /dev/tty1-64 */ - if ((LinuxConsoleFd = open(vtname, O_RDWR|O_NDELAY, 0)) < 0) { - FatalError("LinuxInit: Cannot open %s (%s)\n", - vtname, strerror(errno)); + sprintf(vtname,"/dev/vc/%d",vtno); /* /dev/vc/1-64 */ + if ((LinuxConsoleFd = open(vtname, O_RDWR|O_NDELAY, 0)) < 0) + { + FatalError("LinuxInit: Cannot open %s (%s)\n", + vtname, strerror(errno)); + } } /* change ownership of the vt */ @@ -114,6 +118,7 @@ * Why is this needed? */ LinuxCheckChown ("/dev/tty0"); + LinuxCheckChown ("/dev/vc/0"); /* TODO: only the correct one */ /* * Linux doesn't switch to an active vt after the last close of a vt, * so we do this ourselves by remembering which is active now. @@ -456,8 +461,8 @@ } } close(LinuxConsoleFd); /* make the vt-manager happy */ - fd = open ("/dev/tty0", O_RDWR|O_NDELAY, 0); - if (fd >= 0) + if ((fd = open ("/dev/tty0", O_RDWR|O_NDELAY, 0) > 0) || + (fd = open ("/dev/vc/0", O_RDWR|O_NDELAY, 0) > 0)) { memset (&vts, '\0', sizeof (vts)); /* valgrind */ ioctl (fd, VT_GETSTATE, &vts);