/* Helper for event waits. Used to implement the legacy event waiting ioctls in terms of events  */
int vt_waitactive(int n)
/* Helper for event waits. Used to implement the legacy event waiting ioctls in terms of events  */
int vt_waitactive(int n)
{
	struct vt_event_wait vw;
	do {
		if (n == fg_console + 1)
			break;
		vw.event.event = VT_EVENT_SWITCH;
		vt_event_wait(&vw);
		if (vw.done == 0)
			return -EINTR;
	} while (vw.event.newev != n);
	return 0;
}