After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 315313 - gdm should use VT_GETSTATE for peeking vt freeness
gdm should use VT_GETSTATE for peeking vt freeness
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
2.6.0.x
Other All
: Normal minor
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2005-09-05 21:06 UTC by Samuel Thibault
Modified: 2005-11-04 17:33 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
replace VT_OPENQRY loop by VT_GETSTATE (1.50 KB, patch)
2005-10-30 22:05 UTC, Samuel Thibault
none Details | Review

Description Samuel Thibault 2005-09-05 21:06:37 UTC
Hi,

In daemon/getvt.c:get_free_vt(), gdm loops using VT_OPENQRY() and dummy-opening
VTs below GdmFirstVT, just for getting a free VT. This is quite poor:
while doing that, gettys will find that their assigned VT are being used,
and hence delay their initialization.

A better approach would be to open "/dev/tty1" (which is always busy anyway),
and on that, call

 struct vt_stat vtstat;
 ioctl(fd, VT_GETSTATE, &vtstat);

and just directly open /dev/ttyn where n is the first available VT whose
bit is 0 in vtstat.v_state, starting from GdmFirstVT.

Regards,
Samuel


Other information:
Comment 1 Brian Cameron 2005-09-06 23:10:15 UTC
I would accept a patch to make this change.
Comment 2 Samuel Thibault 2005-10-30 22:05:48 UTC
Created attachment 54103 [details] [review]
replace VT_OPENQRY loop by VT_GETSTATE

Here is a patch
Comment 3 Brian Cameron 2005-11-04 01:18:36 UTC
Fixed in CVS and 2.12 branch.

Thanks!