mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Free tty at detach().
Tested by: `pstat -t` Requested by: phk
This commit is contained in:
parent
7ad8bf410d
commit
2a8436eae5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=130301
@ -1037,6 +1037,14 @@ static int cx_detach (device_t dev)
|
|||||||
|
|
||||||
if (!d || d->chan->type == T_NONE)
|
if (!d || d->chan->type == T_NONE)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
#if __FreeBSD_version >= 502113
|
||||||
|
if (d->tty) {
|
||||||
|
ttyrel (d->tty);
|
||||||
|
d->tty = NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef NETGRAPH
|
#ifdef NETGRAPH
|
||||||
#if __FreeBSD_version >= 500000
|
#if __FreeBSD_version >= 500000
|
||||||
if (d->node) {
|
if (d->node) {
|
||||||
@ -1735,7 +1743,13 @@ static int cx_close (dev_t dev, int flag, int mode, struct thread *td)
|
|||||||
splx (s);
|
splx (s);
|
||||||
d->callout = 0;
|
d->callout = 0;
|
||||||
|
|
||||||
/* Wake up bidirectional opens. */
|
/*
|
||||||
|
* Wake up bidirectional opens.
|
||||||
|
* Since we may be opened twice we couldn't call ttyrel() here.
|
||||||
|
* So just keep d->tty for future use. It would be freed by
|
||||||
|
* ttyrel() at cx_detach().
|
||||||
|
*/
|
||||||
|
|
||||||
wakeup (d);
|
wakeup (d);
|
||||||
d->open_dev &= ~0x2;
|
d->open_dev &= ~0x2;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user