add some spltty() calls around TTY_LOCK() calls that didn't have them
This commit is contained in:
parent
a19008b17f
commit
f8e0478668
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kern_exit.c,v 1.137 2004/03/02 09:15:26 yamt Exp $ */
|
||||
/* $NetBSD: kern_exit.c,v 1.138 2004/03/05 07:27:22 dbj Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
|
||||
|
@ -74,7 +74,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.137 2004/03/02 09:15:26 yamt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.138 2004/03/05 07:27:22 dbj Exp $");
|
||||
|
||||
#include "opt_ktrace.h"
|
||||
#include "opt_perfctrs.h"
|
||||
|
@ -272,6 +272,7 @@ exit1(struct lwp *l, int rv)
|
|||
struct tty *tp;
|
||||
|
||||
if (sp->s_ttyvp) {
|
||||
int s;
|
||||
/*
|
||||
* Controlling process.
|
||||
* Signal foreground pgrp,
|
||||
|
@ -279,6 +280,7 @@ exit1(struct lwp *l, int rv)
|
|||
* and revoke access to controlling terminal.
|
||||
*/
|
||||
tp = sp->s_ttyp;
|
||||
s = spltty();
|
||||
TTY_LOCK(tp);
|
||||
if (tp->t_session == sp) {
|
||||
if (tp->t_pgrp)
|
||||
|
@ -287,6 +289,7 @@ exit1(struct lwp *l, int rv)
|
|||
tp->t_pgrp = NULL;
|
||||
tp->t_session = NULL;
|
||||
TTY_UNLOCK(tp);
|
||||
splx(s);
|
||||
SESSRELE(sp);
|
||||
(void) ttywait(tp);
|
||||
/*
|
||||
|
@ -295,8 +298,10 @@ exit1(struct lwp *l, int rv)
|
|||
*/
|
||||
if (sp->s_ttyvp)
|
||||
VOP_REVOKE(sp->s_ttyvp, REVOKEALL);
|
||||
} else
|
||||
} else {
|
||||
TTY_UNLOCK(tp);
|
||||
splx(s);
|
||||
}
|
||||
if (sp->s_ttyvp)
|
||||
vrele(sp->s_ttyvp);
|
||||
sp->s_ttyvp = NULL;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: tty.c,v 1.162 2004/02/22 17:51:25 jdolecek Exp $ */
|
||||
/* $NetBSD: tty.c,v 1.163 2004/03/05 07:27:22 dbj Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1982, 1986, 1990, 1991, 1993
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.162 2004/02/22 17:51:25 jdolecek Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.163 2004/03/05 07:27:22 dbj Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -1165,9 +1165,11 @@ ttioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p)
|
|||
break;
|
||||
}
|
||||
case TIOCSTAT: /* get load avg stats */
|
||||
s = spltty();
|
||||
TTY_LOCK(tp);
|
||||
ttyinfo(tp);
|
||||
TTY_UNLOCK(tp);
|
||||
splx(s);
|
||||
break;
|
||||
case TIOCSWINSZ: /* set window size */
|
||||
if (memcmp((caddr_t)&tp->t_winsize, data,
|
||||
|
@ -1763,9 +1765,11 @@ ttread(struct tty *tp, struct uio *uio, int flag)
|
|||
ISSET(lflag, IEXTEN|ISIG) == (IEXTEN|ISIG)) {
|
||||
pgsignal(tp->t_pgrp, SIGTSTP, 1);
|
||||
if (first) {
|
||||
s = spltty();
|
||||
TTY_LOCK(tp);
|
||||
error = ttysleep(tp, &lbolt,
|
||||
TTIPRI | PCATCH | PNORELOCK, ttybg, 0);
|
||||
splx(s);
|
||||
if (error)
|
||||
break;
|
||||
goto loop;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: tty_pty.c,v 1.73 2004/02/22 17:51:26 jdolecek Exp $ */
|
||||
/* $NetBSD: tty_pty.c,v 1.74 2004/03/05 07:27:22 dbj Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1989, 1993
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: tty_pty.c,v 1.73 2004/02/22 17:51:26 jdolecek Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: tty_pty.c,v 1.74 2004/03/05 07:27:22 dbj Exp $");
|
||||
|
||||
#include "opt_compat_sunos.h"
|
||||
|
||||
|
@ -508,7 +508,9 @@ ptcwakeup(tp, flag)
|
|||
int flag;
|
||||
{
|
||||
struct pt_softc *pti = pt_softc[minor(tp->t_dev)];
|
||||
int s;
|
||||
|
||||
s = spltty();
|
||||
TTY_LOCK(tp);
|
||||
if (flag & FREAD) {
|
||||
selnotify(&pti->pt_selr, NOTE_SUBMIT);
|
||||
|
@ -519,6 +521,7 @@ ptcwakeup(tp, flag)
|
|||
wakeup((caddr_t)&tp->t_rawq.c_cf);
|
||||
}
|
||||
TTY_UNLOCK(tp);
|
||||
splx(s);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
|
|
Loading…
Reference in New Issue