diff options
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r-- | sys/kern/tty.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c index c9a56fd..1214513 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -730,9 +730,11 @@ ttioctl(tp, cmd, data, flag) void *data; { register struct proc *p; + struct thread *td; int s, error; - p = curproc; /* XXX */ + td = curthread; /* XXX */ + p = td->td_proc; /* If the ioctl involves modification, hang if in the background. */ switch (cmd) { @@ -851,7 +853,7 @@ ttioctl(tp, cmd, data, flag) ISSET(constty->t_state, TS_CONNECTED)) return (EBUSY); #ifndef UCONSOLE - if ((error = suser_xxx(p->p_ucred, NULL, 0)) != 0) + if ((error = suser(td)) != 0) return (error); #endif constty = tp; @@ -1023,9 +1025,9 @@ ttioctl(tp, cmd, data, flag) splx(s); break; case TIOCSTI: /* simulate terminal input */ - if ((flag & FREAD) == 0 && suser_xxx(p->p_ucred, NULL, 0)) + if ((flag & FREAD) == 0 && suser(td)) return (EPERM); - if (!isctty(p, tp) && suser_xxx(p->p_ucred, NULL, 0)) + if (!isctty(p, tp) && suser(td)) return (EACCES); s = spltty(); (*linesw[tp->t_line].l_rint)(*(u_char *)data, tp); @@ -1099,7 +1101,7 @@ ttioctl(tp, cmd, data, flag) } break; case TIOCSDRAINWAIT: - error = suser_xxx(p->p_ucred, NULL, 0); + error = suser(td); if (error) return (error); tp->t_timeout = *(int *)data * hz; |