Set t_timeout to its default sysctl value only once in ttyopen
Initialize t_timeout to -1 for this reason Pointed-by: bde
This commit is contained in:
parent
af5bd99e9a
commit
4eaed34ba0
@ -223,7 +223,8 @@ ttyopen(device, tp)
|
||||
bzero(&tp->t_winsize, sizeof(tp->t_winsize));
|
||||
}
|
||||
/* XXX don't hang forever on output */
|
||||
tp->t_timeout = drainwait*hz;
|
||||
if (tp->t_timeout < 0)
|
||||
tp->t_timeout = drainwait*hz;
|
||||
ttsetwater(tp);
|
||||
splx(s);
|
||||
return (0);
|
||||
@ -2402,6 +2403,7 @@ ttymalloc(tp)
|
||||
return(tp);
|
||||
tp = malloc(sizeof *tp, M_TTYS, M_WAITOK);
|
||||
bzero(tp, sizeof *tp);
|
||||
tp->t_timeout = -1;
|
||||
ttyregister(tp);
|
||||
return (tp);
|
||||
}
|
||||
|
@ -157,6 +157,7 @@ ptyinit(n)
|
||||
|
||||
devs->si_drv1 = devc->si_drv1 = pt;
|
||||
devs->si_tty = devc->si_tty = &pt->pt_tty;
|
||||
pt->pt_tty.t_timeout = -1;
|
||||
ttyregister(&pt->pt_tty);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user