Fix a bug that will cause a process that calls the VT_WAITACTIVE ioctl

to become unkillable when that process is sent a termination signal.  The
process will sit in waitvt looping in the kernel, and chewing up all
available CPU until the system is rebooted.

Submitted by:	Jilles Tjoelker <jilles@stack.nl>
Reviewed by:	bde
Approved by:	re (kensmith)
MFC after:	1 week
This commit is contained in:
Joe Marcus Clarke 2007-09-19 03:59:33 +00:00
parent c577145195
commit e1433e6b8a

View file

@ -1073,8 +1073,7 @@ scioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
scp = sc_get_stat(SC_DEV(sc, i));
if (scp == scp->sc->cur_scp)
return 0;
while ((error=tsleep(&scp->smode, PZERO|PCATCH,
"waitvt", 0)) == ERESTART) ;
error = tsleep(&scp->smode, PZERO | PCATCH, "waitvt", 0);
return error;
case VT_GETACTIVE: /* get active vty # */