Bug 4357

Summary: the X server should check VT status
Product: xorg Reporter: Samuel Thibault <samuel.thibault>
Component: Server/GeneralAssignee: Adam Jackson <ajax>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: minor    
Priority: high    
Version: 6.8.2   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Samuel Thibault 2005-09-05 13:51:44 UTC
Hi,

When running "X vt2" while something already runs on vt2 (getty for instance),
X doesn't get keypresses (getty does), which is kind of annoying for merely
killing the server for instance :)

In Xserver/hw/xfree86/os-support/linux/lnx_init.c, there should be some
check like when VTnum != -1 && !ShareVTs:

    struct vt_stat vtstat;
 
    if ((ioctl(fd, VT_GETSTATE, &vtstat) < 0))
	FatalError("failed to query vt %d availability", vtno);
 
    if (vtstat.v_state & (1<<vtno))
	FatalError("/dev/%s: already in use", tty);
 
fd being opened from /dev/tty0.

Only vt 1-15 can be checked this way (because of the size of vtstat.v_state),
but this is safer than nothing.

Regards,
Samuel
Comment 1 Adam Jackson 2005-10-21 23:26:18 UTC
taking
Comment 2 Daniel Stone 2007-02-27 01:27:54 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 3 chemtech 2013-03-15 14:36:53 UTC
Samuel Thibault 
Do you still experience this issue with newer soft ?
Please check the status of your issue.
Comment 4 Samuel Thibault 2014-09-12 16:37:39 UTC
It seems I never got a mail for comment from chemtech 2013-03-15. I've just tried with Xorg 7.7, I don't have the issue any more. I guess that's thanks to input & evdev.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.