MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / ttydisc_modem

Function ttydisc_modem

components/lwp/terminal/freebsd/tty_ttydisc.c:647–681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

645}
646
647void ttydisc_modem(struct lwp_tty *tp, int open)
648{
649 tty_assert_locked(tp);
650
651 if (open)
652 cv_broadcast(&tp->t_dcdwait);
653
654 /*
655 * Ignore modem status lines when CLOCAL is turned on, but don't
656 * enter the zombie state when the TTY isn't opened, because
657 * that would cause the TTY to be in zombie state after being
658 * opened.
659 */
660 if (!tty_opened(tp) || CMP_FLAG(c, CLOCAL))
661 return;
662
663 if (open == 0)
664 {
665 /*
666 * Lost carrier.
667 */
668 tp->t_flags |= TF_ZOMBIE;
669
670 lwp_tty_signal_sessleader(tp, SIGHUP);
671 tty_flush(tp, FREAD | FWRITE);
672 }
673 else
674 {
675 /*
676 * Carrier is back again.
677 */
678
679 /* XXX: what should we do here? */
680 }
681}
682
683static int ttydisc_echo_force(struct lwp_tty *tp, char c, int quote)
684{

Callers 1

tty_rel_goneFunction · 0.85

Calls 2

tty_flushFunction · 0.85

Tested by

no test coverage detected