GNOME Bugzilla – Bug 315313
gdm should use VT_GETSTATE for peeking vt freeness
Last modified: 2005-11-04 17:33:29 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:
I would accept a patch to make this change.
Created attachment 54103 [details] [review] replace VT_OPENQRY loop by VT_GETSTATE Here is a patch
Fixed in CVS and 2.12 branch. Thanks!