| 415 | } |
| 416 | |
| 417 | void lwp_tty_delete(lwp_tty_t tp) |
| 418 | { |
| 419 | /* |
| 420 | * ttyydev_leave() usually frees the i/o queues earlier, but it is |
| 421 | * not always called between queue allocation and here. The queues |
| 422 | * may be allocated by ioctls on a pty control device without the |
| 423 | * corresponding pty slave device ever being open, or after it is |
| 424 | * closed. |
| 425 | */ |
| 426 | ttyinq_free(&tp->t_inq); |
| 427 | ttyoutq_free(&tp->t_outq); |
| 428 | rt_wqueue_wakeup_all(&tp->t_inpoll, (void *)POLLHUP); |
| 429 | rt_wqueue_wakeup_all(&tp->t_outpoll, (void *)POLLHUP); |
| 430 | |
| 431 | #ifdef USING_BSD_POLL |
| 432 | knlist_destroy(&tp->t_inpoll.si_note); |
| 433 | knlist_destroy(&tp->t_outpoll.si_note); |
| 434 | #endif |
| 435 | |
| 436 | cv_destroy(&tp->t_inwait); |
| 437 | cv_destroy(&tp->t_outwait); |
| 438 | cv_destroy(&tp->t_bgwait); |
| 439 | cv_destroy(&tp->t_dcdwait); |
| 440 | cv_destroy(&tp->t_outserwait); |
| 441 | |
| 442 | if (tp->t_mtx == &tp->t_mtxobj) |
| 443 | rt_mutex_detach(&tp->t_mtxobj); |
| 444 | ttydevsw_free(tp); |
| 445 | rt_device_unregister(&tp->parent); |
| 446 | rt_free(tp); |
| 447 | } |
| 448 | |
| 449 | /* |
| 450 | * Report on state of foreground process group. |
no test coverage detected